On 10/27/2014 10:01 AM, Scot Hacker wrote: > > > On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote: > > > add2virtualenv /path/to/custom/apps/directory > > > > And when its time to deploy, you'll need to do similar on the server, > using an equivalent method in the wsgi definition, e.g.: > > import os, sys, site > > sys.path.append('/path/to/custom/apps/directory')
Please don't do this. There is no good reason to add complexity to the sys.path required for your site to run. Everything is simpler if you have a single "root path" for all Python code in your project, and make all import paths relative to that single filesystem location (which should generally be the location of `manage.py`). If you don't want to have to import from "apps.users", then just get rid of the "apps/" directory and move all the apps in there up one filesystem level. Django apps aren't special, they're just Python modules; they can be placed into a logical module hierarchy just like any other module. Carl
signature.asc
Description: OpenPGP digital signature