On Fri, Sep 12, 2008 at 11:15 AM, Jeff Anderson
<[EMAIL PROTECTED]> wrote:

> You can influence what this list is, by setting the PYTHONPATH
> environmental variable. All you need to do is set your PYTHONPATH
> appropriately, and point it to the appropriate place, depending on which
> Django installation you need to use. Anything in the PYTHONPATH
> environmental variable is put at the beginning of sys.path in the python
> interpretor.
>
> You can't just rename the django directory and expect it to work-- it won't.

Thanks for the PYTHONPATH tutorial.  I notice that
\site-packages\django is not explicitly listed, though other
subdirectories of \site-packages are.  I assume that there is an
implied search of subdirectories w/ PYTHONPATH and that is why Django
still runs.

If I understand correctly then, I would want to rename my 0.96 django
directory to "django096", move it OUT of sitepackages so it isn't
found accidentally, install django version 1.0.  Now I have \django
(1.0) under sitepackages and 0.96 elsewhere.  Using a "from django"
import statement will give me 1.0 as default.

If I wanted to use 0.96 instead, I would need to set my PYTHONPATH env
var to the copied \django096 directory.  When I start Python/Django,
this directory would be inserted at the beginning of the sys.path
list, so Python would now use \django096 preferentially to
\site-packages\django, giving me v0.96 behavior.  My import statements
would still be "from django" and not "from django096".

Because all of the django imports will be detected first in the
\django096 directory, using "from django" will not burn me, even with
the nested import statements that Steve Holden was talking about.  (I
could imagine other reasons to get burned, but you say this has worked
well for you in the past, so I'm assuming they don't happen.)

Do I have the above correct?

Matt

--~--~---------~--~----~------------~-------~--~----~
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