OK, my setup before put both all the different ones in the same path

I had:
/home/user/django_projects/project_sandbox
/home/user/django_projects/project_staging
etc.

Now:
/home/user/production/project_name
/home/user/staging/project_name
etc.

Before, I would add /home/user/django_projects to the PythonPath in
Apache and so I would have to declare my imports as [from
project_sandbox.app.models import blah] because all three environments
were available to Apache.  Now, with each having the same name, but
different parent directory I can add /home/user/sandbox to my
PythonPath for Apache and then the project_name is the same for each
project and so the imports are the same.

Thanks for clearing that up for me!
Sean.

On Mar 19, 8:07 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> 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/2309bb7...
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to