Your Ad Here

Thursday, January 5, 2012

project root or its parent in pythonpath?

Upon reading the django tutorial, I was under the impression that you should
have the project root folder in your pythonpath, so that each app is available
for import in modules, e.g. you can do

import myapp

However, my IDE seems to prefer putting its root in the pythonpath, so you'd
have to

import project.myapp

and also it seems that the documentation for WSGI deployment expect the
same (with project.settings)

What is recommended?

I have two apps which are inter-dependent and import stuff from one
another; if I decide to go for the project.app route, is there a way to import
things without a reference to the project name? otherwise the imports would
have to be rewritten when the apps are installed in another projcet.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 comments:

Post a Comment