On Thu, Feb 19, 2009 at 12:42 AM, David Zhou <da...@nodnod.net> wrote:
> > Nevermind -- I'd always imported settings first, but since that's not > always the case (such as third party apps), things act strangely. > > Short of changing something in django core, is there any way of adding > to sys.path dynamically before any django code gets run? > > -- dz > > > > On Thu, Feb 19, 2009 at 12:10 AM, David Zhou <da...@nodnod.net> wrote: > > I've been doing the following for a while, but I'm not sure if it has > > unintended side effects: > > > > #settings.py > > import os, sys > > sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), > > 'apps')) > > > > I keep pluggable apps in an svn repo, and do checkouts of the ones I > > need in the apps folder that's specific to whatever site I'm working > > on. And since I do this for most of my projects, I figured it'd be > > easier to make sure it was in the pythonpath rather than relying on > > the environment to properly define pythonpath. > > > > Is it considered bad practice to dynamically modify the pythonpath in > > something like settings.py? > > > > -- dz > > > > > > There is no 1 generic way to handle it but IME the following 3 will handle any application: 1) in manage.py for runserver(probably not an issue since it's using your users PYTHONPATH anyway) 2) in the .wsgi file for wsgi, this is a bit of a no brainer 3) in the httpd.conf for apache(or whatever that file is named). Hope this helps some, Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---