The Frame for Work

Now that I have my Apache web server and Subversion up and running it’s time to install the Django Framework that I want to use to create the site (read previous posts if you have no clue what I am rambling about).

Django is a Python framework so we need to have Python installed. I am running Ubuntu 7.04 so it comes with it installed. If you do not have it just go to http://www.python.org/ to get it.

The one awesome thing about Django is the Documentation. If you want to know something, they’ve documented it including easily setting it up (http://www.djangoproject.com/documentation/install/). Let’s get started shall we.

To get going you do not need to install Python support in Apache (mod_python) or a Database or any of that. Django comes with a simple development web server just to help you as you develop your site to test. Note that this should not be used as a production web server. We will set that up later when we get there :)

What we do need is to get Django once we have Python. There are two ways that you can get Django. Either by downloading the latest release version, or getting the latest development version via Subversion.

1. Getting the Latest Release Version
Having Ubuntu makes this as simple as pie. Django is available in the repositories. Open a terminal window and type the following:

$ sudo apt-get install python-django

You will notice that when you install it suggest that you should install one of the database adapters for Django to use to connect the database of your choice. If you know which Database you want to use then feel free to install the one best suited to your needs.

I am still toying between MySQL and PostgreSQL. On a project that we are doing at work we use PostgreSQL and I am completely in-love with it so I am leaning that way but I will still see. I have never used MySQL so I will do some reading and see what comes up.

2. Getting the Development Version
Open a Terminal window and go the the directory you would like to put the Django source code. Then enter the following commands:

$ svn co http://code.djangoproject.com/svn/django/trunk/ django_src
$ ln -s `pwd`/django_src/django /usr/lib/python2.5/site-packages/django

Change the last line to use the version of Python that you are using.

Copy “django_src/django/bin/django-admin.py” to your system path so that it’s accessible everywhere like “/usr/local/bin”. Now we are done. We have the framework for the next step :)

Next I will be setting up a Database and the Adapter necessary for Django.

3. Useful Links

  1. http://www.djangoproject.com/
  2. http://www.djangosnippets.org/
  3. http://www.djangobook.com/
  4. http://groups.google.com/group/django-users/
  5. http://groups.google.com/group/django-developers/

2 Responses to “The Frame for Work”

  1. keep up the posts; i’m definately paying attention. love the concept.

  2. Hey Kevin, thanks for the support. Hope you enjoy the ones to come.

    We are busy releasing a system for our client now at work so the hours are long. Hoping the next instalment will be tomorrow :)

    Till then.


Leave a Reply