Feeds:
Posts
Comments

Archive for the ‘Django’ Category

Hai,

To insall django on Fedora 14, open a terminal and as a root user type

yum install Django

🙂

Advertisements

Read Full Post »

Today i tried installing django on ubuntu 9.10

First of all, let me define about Django:

Django:

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Source : http://www.djangoproject.com/

Prerequisites:

1. Install Python (version 2.4 to 2.6). ( By default, Python is installed in most of the Linux like systems )

2. Install Subversion. ( Since im going to get the latest development of Django i opt of installing django through Subversion )

To install it type apt-get install subversion from the terminal as a root user.

3. Find the location of the python installed and the site-packages directory.

4. To know the location, issue the command from the terminal.

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

U will get the output as ( on ubuntu 9.10 )

/usr/lib/python2.6/dist-packages 

Installing Django code :

1. Get the latest software using svn command.

svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk

2. Create a symbolic link to make sure that the Python interpreter can load Django’s code.

ln -s /home/ubuntu/django-trunk/django /usr/lib/python2.6/dist-packages/django

/home/ubuntu – is my home directory. replace your home directory with it.

3. Create a symbolic link to the file django-trunk/django/bin/admin.py in a directory on your system path such as /usr/local/bin

ln -s /home/ubuntu/django-trunk/django/bin/django-admin.py /usr/local/bin

That’s all. To check whether Django is installed or not type python from the terminal. Then import django module as shown below.

ubuntu@ubuntu:~$ python
Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)
[GCC 4.4.1] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import django
>>>

It says no error. It implies django is installed.

But fortuantely, i got Import Error, No module named django.

I started searching the solution for it. Then i found bin file is missing inside django directory

To make it work, changed my working directory into into django-trunk directory.

Ran svn update command.

The neccessary files  got downloaded.

Again entered into  python interpreter, and imported django module. No error 🙂

Wow..now django is installed 🙂

Im going to play with it.

Read Full Post »