A few more important things to note:

Your projects shouldn't live within your virtualenv directory. You can
create projects and virtualenvs with the same name (I often do), but it's
not mandatory.

So here's an example setup

~/virtual/djangotrunk
~/virtual/socialwebzone

~/projects/socialwebzone
~/projects/polls
~/projects/csvimporter

The projects listed can run in any of the virtual environments, although
their behavior would probably vary (for example, if you have django 1.1 in
~/virtual/socialwebzone).

What you *must do* is customize the PYTHONPATH variable upon activating an
environment. This can be done in many ways. For example, by manually editing
the activate script[1] in each virtualenv. Or, if using
virtualenvwrapper[2], by creating a postactivate hook script[3]. This is
where having the same name for a project and virtualenv can come in handy,
because then you can programatically add ~/projects/<virtualenvname> to the
PYTHONPATH.


Cheers,
André Terra


[1] example activate script on windows (not perfect):
http://dpaste.com/hold/564313/
[2] http://www.doughellmann.com/docs/virtualenvwrapper/index.html
[3]
http://www.doughellmann.com/docs/virtualenvwrapper/scripts.html#postactivate



On Wed, Jul 6, 2011 at 7:18 AM, DrBloodmoney <drbloodmo...@gmail.com> wrote:

> On Wed, Jul 6, 2011 at 3:31 AM, i...@webbricks.co.uk
> <i...@webbricks.co.uk> wrote:
> > oh yeah
> >
> http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/
> >
> > that page is my goto reference on building a virtualenv, you might
> > have already found it, but if not...
> >
> > On Jul 5, 10:28 pm, Jeremy <jeremycran...@gmail.com> wrote:
> >> AHHH, that makes a little more sense.  I'm trying to install apps from
> >> Github.  Things like Pinax, and different individual blogging apps so
> >> that I can "plug" them into one Django project to give it multiple
> >> bits of social functionality.  Obviously I'm having a lot of trouble
> >> (some of it being that it sounds like I don't even know what I'm
> >> saying).  I've tried to install these apps through PIP and other forms
> >> on Dreamhost, but it keeps saying that I don't have permission.  The
> >> way that I believed to get around this is to set up virtualenv on my
> >> shared server space, and create the project inside of that, correct?
> >> But if I do this, how can I view the project that I creating live?
> >>
> >> Again, if this all sounds foolish, keep in mind I'm incredibly new to
> >> all these concepts and my not understand them enough.  I've been
> >> looking for someone locally to give me some Django lessons, but I keep
> >> coming up dry.
> >>
> >> Let me know if anyone can assist me.  Thanks guys.
> >>
>
> The two most important things to concern yourself with regarding
> starting developing with virtualenv (which is a must):
>
> - source /path/to/venv/bin/activate: this command tells the shell
> (bash, zsh, etc) to use the python interpreter located at
> /path/to/venv/bin/python instead of the system python interpreter (eg.
> /usr/bin/python)
>
> - the pythonpath for your virtualenv is going to be
> /path/to/venv/lib/python/site-packages. I usually maintain a separate
> directory containing packages I need (either at ~/libraries for global
> libraries, third-party apps, etc on my dev box) and
> /path/to/venv/libraries on production boxes. Then I symlink python
> modules that I need to the /path/to/venv/lib/python/site-packages
> directory. Then they'll be on your PYTHONPATH.
>
> The above applies to developing on a *nix box. If you are developing
> on windows, stop what you are doing and install virtualbox and ubuntu
> or go fully over to a *nix box. You'll appreciate it this.
>
> --
> 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.
>
>

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

Reply via email to