Installing Django on Centos 5

In preparing to upgrade this server to Centos 5.x, I did a test install of the Centos "Server" configuration using VirtualBox. The "Server" configuration comes with Apache 2.x, Python 2.4, and mod_python pre-loaded.

Installing Django

Here are the commands needed to install the latest version of Django:

$ yum install subversion
$ cd /var/www
$ mkdir django-src
$ cd django-src
$ svn co http://code.djangoproject.com/svn/django/trunk/
$ cd trunk
$ python setup.py install

Installing and Starting MySQL Server

Here are commands needed to install and start MySQL:

$ yum install mysql-server
$ /etc/rc.d/init.d/mysqld start

Installing Python MySQL Support

This is the trickiest part. Python talks to MySQL using software called MySQLdb. The version available in Centos via Yum is 1.2.1-1 and isn't compatible with the most recent Django codebase. Because of this you must download and compile MySQLdb.

Before compiling MySQLdb, enter the command below to make sure you have the necessary tools:

$ yum install python-devel mysql-devel gcc

Next, download the source tarball from SourceForge then follow these steps:

$ mv <name of MySQLdb tarball> ~
$ cd ~
$ tar zxvf <filename of MySQLdb tarball>
$ cd <name of resulting directory>
$ python setup.py build
$ python setup.py install

When these steps are completed you should be good to go.

7 comments on Installing Django on Centos 5

  1. Hermes handbags (not verified)
    Sun, 2010-06-27 07:42

    Buy designer Hermes handbags online. Hermes bags buy Hermes Wallets for cheap 张亚楠测试

  2. Tim Child (not verified)
    Mon, 2010-04-05 09:02

    Nice little write up, I had a need to use Postgres on the backend so if anyone is interested I have wrote up my experiences with Django on CentOS and postgres (I also tried with RedHat).

    http://blog.timc3.com/2010/03/26/django-on-redhat-or-centos/

    I also go a bit more indepth into keeping the application running.

  3. Tim Child (not verified)
    Mon, 2010-04-05 09:01

    Nice little write up, I had a need to use Postgres on the backend so if anyone is interested I have wrote up my experiences with Django on CentOS and postgres (I also tried with RedHat).

    http://blog.timc3.com/2010/03/26/django-on-redhat-or-centos/

    I also go a bit more indepth into keeping the application running.

  4. sdf (not verified)
    Tue, 2010-03-30 05:52

    louis vuitton

    [url=http://www.flashreplica.com]louis vuitton[/url]

  5. Jamesss (not verified)
    Wed, 2010-02-24 07:18

    Panerai watches made great contribution in terms of making the Replica Breitling popular. Replicas Rolex are accurate duplicates of the authentic timepieces from every detail. The workmen producing Watches replica master excellent replicating skills, making sure every detail of breitling replica looks identical the originals. And gucci replica are priced very reasonable. Gf Ferre Watches as we mentioned above, are carbon copies of the Replica Bell & Ross. In terms of advanced technology and good materials, Omega replicas are not bad, too. Tag Heuer replicas are regarded as a blend of sophistication, elegance as well as the latest style.

  6. Anonymous (not verified)
    Wed, 2010-02-03 03:40

    Movado watchesreplica watches Doxa has honored its 120 breitling watches years of watch manufacturing tradition with the release of tag heuer its new limited edition of the patek philippe Chateau de Monts Watch, introduced rolex back in the 1920. This is a audemars piguet classic watch which would omega watches bring people back to many montblanc watches years ago. Yet it is a watch which cartier watches does not lack of the elements of fashion and style.Doxa has, panerai watches This watch brings back the old bvlgari watches spirit of the watch making artistry, when the standards of armani watches quality were always kept at the replica rolex watches highest levels and the designs were replica watches so carefully chosen as to be considered replica tagheuer watches fashionable even today.The amazing vintage Chateau breitling watches de Monts Limited Edition watch presents a version of replica cartier watchessimplicity and good taste, a watch that doesn't need much replica omega watches have come a long way in history.

  7. nelson_jerk (not verified)
    Tue, 2009-10-20 10:21

    I also use CentOS for my production work. Although I prefer to install the latest Python (2.5.x) and build all the necessary libraries from source. Personally I prefer using mod_wsgi over mod_python and the “so-called stable release” of Django. I have had a couple of bad experiences with using the SVN version in development and production. One time I was coding against an SVN checkout, 640-801 when I deployed on production I checked out a more recent version which broke some of my code. Of course I could have avoided that by frequently checking out the SVN trunk during development. But that’s really against the tagline “perfectionists with deadlines”. When I’m on a deadline, I can’t simply code around every issue that crops up because of some changes in the SVN release. MB2-631 It’s really a matter of personal preference, and I do prefer coding against a “stable” API. Sure I might miss a few important features, but it’s nothing totally groundbreaking. The only thing I really miss on the 0.96 release are the newforms updates, especially the working FileField. 70-271 With regards to lighttpd and memcached, have you tried using the RPMForge repository? The memcached and lighttpd packages are pretty much up to date.