Login

Tag "sys.path"

Snippet List

manage.py with magic python path

I tend to have all my python code together in a 'python' directory. e.g. a typical project layout of mine looks like: /python /python/myproject - project python code /python/django - local copy of django /python/foolib - some third party library /media /templates ... Since I don't want to set the python path explicitly I just assume the 'manage.py' is in the right place and use its __file__ variable to set up the python path correctly. I use the same trick for my settings.py for setting MEDIA_ROOT and TEMPLATE_DIRS.

  • python
  • path
  • magic
  • pythonpath
  • sys.path
Read More

1 snippet posted so far.