background preloader

Django

Facebook Twitter

Howto Install Django on an Ubuntu Linux Server. Today I had the task of installing a development server running the Django Python framework for one of our web developers.

Howto Install Django on an Ubuntu Linux Server

I learned a few things and I figured a quick tutorial might help someone else out. None of this covers new ground, but perhaps another telling of the story will help someone out there. I started from scratch, with a basic install of Ubuntu 7.04 Server Edition. I did not choose any extra packages, such as the LAMP option or DNS server. If you are starting off with a LAMP server already installed, or a different version, the steps will be similiar, but you may need to adapt some commands to get them to work. Install server software Install Apache, Mod_Python, MySQL and MySQLdb.

Sudo apt-get install apache2 libapache2-mod-python sudo apt-get install mysql-server python-mysqldb Install the Django source code At this point you have a couple of options. Cd ~/ svn co django_src Create Django’s directories Next we need to create some directories that Django will use. Forum / environment variable DJANGO_SETTINGS_MODULE is undefined. Setup Django, Apache and PostgreSQL, Linux. A quick and secure installation and configuration of Django, mod_python and PostgreSQL 8.2 for application development and/or deployment.

Setup Django, Apache and PostgreSQL, Linux

First set up the applications we need by opening a shell (Applications->Accessories->Terminal): ian@lawrence:~$ sudo apt-get install python-psycopg2 python-psycopg postgresql-8.2 postgresql-client-8.2 apache2 libapache2-mod-python subversion pgadmin3 pgadmin3-data Create a folder in the home directory called Web and move into that folder: ian@lawrence:~$ mkdir Web;cd Web Install the latest Django code from svn: ian@lawrence:~/Web$ svn co django_src Python won’t recognize Django unless it is installed in the “site-packages” directory, so create a symbolic link from this checked outsource code to "site-packages" ian@lawrence:~/Web$ sudo ln -s `pwd`/django_src/django /usr/lib/python2.5/site-packages/django Then copy the django-admin.py file into /usr/local/bin so that we can use this tool directly in a shell Create Django’s directories export PYTHONPATH=". to.

How to install Django. This document will get you up and running with Django.

How to install Django

Install Python Being a Python Web framework, Django requires Python. It works with Python 2.7, 3.2 or 3.3. Get the latest version of Python at or with your operating system’s package manager. Django on Jython If you use Jython (a Python implementation for the Java platform), you’ll need to follow a few additional steps.