The benefits of installing Django from .deb compared to .tar.gz?

I am starting Django development and I can either install it from .deb using

$ apt-get install python-django 

on my Ubuntu machine, or I can download .tar.gz from djangoproject.com and start from there.

What are the advantages and disadvantages of each approach?

+4
source share
6 answers

Using apt-get allows your system to monitor the installation (for example, if you want to remove, update or pick up). Installing from the source ( .tar.gz or otherwise) puts you in charge of what and where - you can have several versions installed in different places, etc., but there is no simple “uninstallation” and the like . Personally, I prefer to install my supported OS method ( apt-get , etc.) for packages that I consider to be secondary or auxiliary, directly from svn / hg / & c for those that I contribute or want to support the closest control and .tar.gz (or better if .tar.bz2 available ;-) "snapshots" and "source releases" that are in / in the middle ...

+8
source

The best way to install is to check the code that is always required for a set of changes (branch / tag) and define a symbolic link to it

Checkout the required version:

 # For trunk svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk # For a tag, 1.02 release svn co http://code.djangoproject.com/svn/django/tag/1.02 django-1.02 # To update the trunk cd django-trunk svn up 

Then define a symbolic link

 ln -fs /usr/lib/python2.5/site-packages/django/* ~/django-1.02/ 

If you want to test your code in the latest version, just redefine the symlink:

 ln -fs /usr/lib/python2.5/site-packages/django/* ~/django-trunk/ 

The aptitude and apt-get package managers are good for automatically updating software that you really don't care about developing every day, such as media players, browsers. For the right U code with daily, full version control required, you get it only by source.

+6
source

Using apt-get, you will get better removal support through the package manager, and you can also install dependencies for you. If you install using apt-get, you can get automatic updates, which is very nice for security patches.

With tar, you can get a newer version, and you can get the ability to customize compilation flags. The assembly may be more optimized for your specific processor, but since it is python, it does not matter in this case.

+4
source

Getting Django from your Ubuntu repository gives an older "stable" version. This may be good with you, but I believe that most developers prefer to stick with the latest code available in the trunk to get more features.

IMHO, the cleanest solution is not to install the .tar.gz / SVN version with simple sudo python setup.py install (or use easy-install ), but to create the .deb package. Thus, you should get maximum benefits: 1) all the blood supply functions you want 2) the proper Debian / Ubuntu package that you can easily remove, upgrade and deploy to any number of Debian machines.

Here is a quick and dirty way to do it:

 # # This is dirty (you have been warned) way to quickly # make new Django .deb package from SVN trunk for personal use. # apt-get source python-django apt-get build-dep python-django svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk DJANGO_SVN_REVISION=`LC_ALL=C svn info django-trunk \ | grep ^Revision: | awk '{ print $2 }'` cp -R python-django-*/debian django-trunk/ cd django-trunk dch --newversion=1.1-1ubuntu1~svn${DJANGO_SVN_REVISION} \ "Non-maintainer quick-and-dirty update to SVN r${DJANGO_SVN_REVISION}" dpkg-buildpackage # Have a good sip of tea, coffee or whatever you prefer. # Because of tests, this is going to take quite a while. # You may consider disabling (this is bad!) tests by commenting out # line mentioning "runtests.py" in debian/rules. cd .. dpkg -i python-django_*.deb 

It is not even guaranteed to work (and I'm not even sure about the correct name of the package version), but I tried it myself and it worked for me.

+1
source

I always installed the dev version. (Instructions)

This makes the upgrade very easy and gives you all the attractive features in / dev / docs. I would advise you to try taking this route if possible (if anything gives you an idea of ​​how package sites work).

Note: the recent switch of ubuntu 9.04 to dist packages from package sites (8.04) made this a bit confusing, I had to recreate the link.

0
source

I know with debian, and possibly with some other distributions, the django version in the package manager is branch 0.9, not branch 1.X. Definitely what you want to avoid.

0
source

Source: https://habr.com/ru/post/1285645/


All Articles