Setting up for python django development with Debian Linux

Ned Batchelder ned at nedbatchelder.com
Mon Oct 28 19:20:49 EDT 2013


On 10/28/13 3:46 PM, Gary Roach wrote:
> Hi all,
>
> I have been trying to set up a python, django, mysql, 
> virtualenvwrapper and git development project and am really confused. 
> All of the documentation seems to ignore the apt-get installation 
> methods used by Debian Linux and its derivatives. Does pip install the 
> same as apt-get; I don't think so. If I use virtualenvwrapper, how 
> does this fit with the normal debian (wheezy) installation. I also 
> need git which just confuses the situation even more. Must I give up 
> the automatic updating system that Debian provides when setting up the 
> development environment? The documentation centers on Windoz, Mac and 
> generic Linux distributions and ignores the automation of the Debian 
> installation. All of the documentation I have found concentrates on 
> the installation of individual packages or on the use of python-django 
> and is very sketchy on the overall virtualenv(wrapper), git, 
> python-django file structure and installation order.
>

The two installation techniques (OS-centric and language-centric) 
overlap in some ways, and each has their own strengths.  Some people 
prefer one, some the other.

I would use apt-get to install any non-Python packages, including Python 
itself.  That would be Python, mysql, and git.  I would also use apt-get 
to install virtualenv and/or virtualenvwrapper.  Then create a 
virtualenv, activate it, and use pip to install the Python packages.

The advantage of virtualenv is that you can have more than one (for 
experimenting with other projects), you can delete the whole thing by 
just removing the directory, and it isolates you from the 
system-installed Python packages so you can be sure of what packages you 
are using.

The virtualenv is outside the scope of apt-get, so it's true, you won't 
have Debian helping to keep it up to date.  On the plus side, not all 
Python packages are packaged as Debian packages, and those that are can 
lag, so virtualenv+pip will give you more Python packages to choose 
from, and more recent ones.

--Ned.

> Any help with straightening out my brain in this area will be 
> sincerely appreciated.
>
> Gary R.




More information about the Python-list mailing list