Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Adjusting PYTHONPATH for reusable django apps
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Bennett  
View profile  
 More options Dec 2 2008, 6:59 pm
From: "James Bennett" <ubernost...@gmail.com>
Date: Tue, 2 Dec 2008 17:59:46 -0600
Local: Tues, Dec 2 2008 6:59 pm
Subject: Re: Adjusting PYTHONPATH for reusable django apps
For what it's worth, I'm a huge fan of virtualenv:

http://pypi.python.org/pypi/virtualenv

and of Doug Hellmann's virtualenvwrapper:

http://www.doughellmann.com/projects/virtualenvwrapper/

What virtualenv does, basically, is create an isolated Python
environment into which you can install stuff without affecting any
other Python software on your system. And virtualenvwrapper provides
tools for easily creating, removing and working with virtualenvs.

So my workflow these days goes something like this:

mkvirtualenv somepythonproject

(this creates a new virtualenv, named "somepythonproject", and drops
me into it; if I come back later in another shell, "workon
somepythonproject" will put me back in the virtualenv)

From there I have easy_install for installing Python packages I want
to try out, or I can use the "add2virtualenv" function in
virtualenvwrapper to add a directory to the virtualenv's Python path.
For example:

add2virtualenv ~/dev/my-django-apps/

Within the virtualenv, everything I've installed or added to it is
available, but it doesn't affect anything else on my system; I can
blow it away with no repercussions if I mess something up, or keep
adding/tweaking stuff as needed.

It's even getting easier to do real deployment with this, too;
mod_wsgi supports a directive that lets you point it at a virtualenv
to run a site out of a completely-sandboxed environment, so you can
simply use normal tools within the virtualenv to set things up and not
worry about clashing with anything else.

If you haven't looked into this, I highly recommend it. And maybe in
the 2nd edition of the book I'll try to explain this a bit more
clearly...

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.