Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting up for python django development with Debian Linux

46 views
Skip to first unread message

Gary Roach

unread,
Oct 28, 2013, 7:46:07 PM10/28/13
to python mailing list
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.

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

Gary R.

Ben Finney

unread,
Oct 28, 2013, 11:05:25 PM10/28/13
to pytho...@python.org
Gary Roach <gary71...@verizon.net> writes:

> I have been trying to set up a python, django, mysql,
> virtualenvwrapper and git development project and am really confused.

(Side note: If you have the option, avoid MySQL and begin with
PostgreSQL. It is much more standards-compliant, and avoids many of the
misfeatures and never-fixed bugs in MySQL that will cause you great
grief.)

> All of the documentation seems to ignore the apt-get installation
> methods used by Debian Linux and its derivatives.

Do you mean the Django documentation?

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

You're right, it doesn't. Pip is one step on a long, incomplete progress
of the Python community's attempt to implement dependency-based package
management. It lacks many of the useful features you've come to expect
from modern operating system package managers.

Not least: if your project has any dependencies other than Python
packages, pip cannot help you since it is tied to Python's Distutils.

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

No, you can develop your project on the assumption that APT is available
and that particular repositories will be used. Then you are bound to
only depend on those packages available from those repositories.

There is a huge range of Python packages, Django-specific packages, and
of course non-Python packages, in Debian. So you may find that this will
work fine for you.

But be aware that (unfortunately, in my view) many Python developers do
not want to wait for libraries to be quality-tested in an operating
system's ecosystem; they want to grab each one as soon as it's available
and immediately depend on the latest version.

It is for this desire that installing directly from PyPI is implemented.
And for this, you do indeed abandon the operating system's package
management and all the benefits it brings.

> The documentation centers on Windoz, Mac and generic Linux
> distributions and ignores the automation of the Debian installation.

Yes. Python (and Django) are designed for a range of operating systems,
on some of which package dependency management is nonexistent (MS
Windows) or atrocious (OS/X).

Dependency-based package management is a mature technology with
implementations that avoid many of the problems in pip, but pip serves a
real need: bringing some measure of dependency-based package management
to at least Python libraries, in operating systems that lack anything
better.

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

If you're fortunate enough to be developing on a modern operating system
with dependency-based package management and a rich repository of OS
packages, like Debian, then you can develop software as for anything
else where the packages are available in the OS: ignore pip, and package
your software to depend on other operating system packages.

The Python and Django documentation aren't going to be of much help
there, since they don't try to teach people to package their software to
work with the rest of the operating system (instead advising developers
to pretend the rest of the operating system doesn't exist, insulating
the developer's software in a virtualenv). So you'll need to learn how
to package software for Debian yourself.

--
\ "Those who will not reason, are bigots, those who cannot, are |
`\ fools, and those who dare not, are slaves." —“Lord” George |
_o__) Gordon Noel Byron |
Ben Finney

Ned Batchelder

unread,
Oct 28, 2013, 11:20:49 PM10/28/13
to Gary Roach, python mailing list
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.

rusi

unread,
Oct 29, 2013, 2:59:20 AM10/29/13
to
On Tuesday, October 29, 2013 1:16:07 AM UTC+5:30, 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.

Have you seen this?
https://code.djangoproject.com/wiki/Distributions

It seems to be saying that the standard debian/ubuntu package 'python-django' works

D.M. Procida

unread,
Nov 13, 2013, 11:30:56 PM11/13/13
to
Gary Roach <gary71...@verizon.net> wrote:

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

I assume you've either worked this out or given up by now, but in any
case...

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

Firstly, pip doesn't install in the same way apt-get does.

The general rule is: if it's a Python package (such as Django) use pip;
if it's not (such as MySQL) use apt-get.

Secondly, there is little if any need to install Python packages outside
a virtualenv. It's almost always more convenient to have them in a
virtualenv, rather than system-wide.

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

I just use apt-get to install Git and update it every now and then.

Daniele
0 new messages