On Mon, 2007-03-19 at 23:54 +0000, sphogan wrote: > Hi! I've started to use Django and it's wonderful. I'm about ready > to launch my first production site (around 4,000 visitors daily) and I > found that I was unable to setup the sandbox/staging/production setup > I'm used to having. > > Basically, the problem is that files will have imports in them that > clearly don't change themselves for each environment. I can get > around this while in the same app by just doing a [from models import > blah], but that doesn't work if you're trying to do a [from > project.salt.models import blah] in project.pepper.views. > > Is there any way to make these paths relative to the project they're > in? That way I can hack around on sandbox and just stick it in SVN to > move it to staging without having to change anything and then on to > production likewise.
Your description doesn't make it entirely clear what you're particular staging set up looks like. Traditionally a staging setup is completely separate from the production one; let's assume that is the case here (although I don't quite understand your query about import paths in views). You can set the Python path for each installation (sandbox/staging/production) to point to their particular import root. You don't need to include the project directory in the import path (see [1]) -- this is partly because there may not even be a "project directory" -- so you could have the two installations side-by-side under differently named project directories. Or you could have the same project directory name under different parent directories. [1] http://groups.google.com/group/django-users/browse_frm/thread/2309bb788fd89b0c/c1347b46d9e1445f?lnk=gst&q=Python+path&rnum=1#c1347b46d9e1445f Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---