Install Django¶
Linux¶
The latest version is recommended, Django : 1.4
- Simply follow the instructions on the download page of the Django website:
- https://www.djangoproject.com/download/
- Follow option 1 : download of the latest official version (1.4)
- Verify installation and version of Django.
Verify installation and version of Django¶
- In a console, launch the Python interpretor:
$ python
- Then, try to import Django:
>>> import django
- If there's no error message, Django is installed.
Verify the installed version:>>> django.get_version()
- You should have this output:
'1.4'
Mac¶
The latest version is recommended, Django : 1.4
- Simply follow the instructions on the download page of the Django website:
- https://www.djangoproject.com/download/
- Follow option 1 : download of the latest official version (1.4)
- Verify installation and version of Django.
Verify installation and version of Django¶
- In a console, launch the Python interpretor:
$ python
- Then, try to import Django:
>>> import django
- If there's no error message, Django is installed.
Verify the installed version:>>> django.get_version()
- You should have this output:
'1.4'
Windows¶
Installation tested on Windows XP.
The latest version is recommended, Django : 1.4
- Globally, follow the instructions on the download page of the Django website:
- ... but instead of typing this command:
$ sudo python setup.py install
- type this command in the Python interpretor (launched with administrator privileges):
>>> setup.py install
- If a problem occurs, read the Installation of Django on Windows : step by step section below.
- Verify installation and version of Django.
Installation of Django on Windows : step by step¶
Read this section if you encountered problems when following the official procedure.
- Download the sources : Django-1.4.tar.gz
- you can download it wherever you want... on the Desktop, for instance
- Extract the downloaded file to obtain this directory : Django-1.4
- you can extract it wherever you want... on the Desktop, for instance
- to extract a tar.gz archive, you can download bsdtar, a command-line tool...
- ... or use a graphic tool such as 7-zip.
- if you're blocked at this step, arrive earlier at the workshop, Montréal-Python team will give you the sources on a USB key
- Install Django from the sources
- Launch the Python interpretor (Windows XP path):
Start > Programs > Python 2.7 > Python (command line) - Run the Django installation file:
>>> setup.py install
The setup.py file to be run with Python is directly in the Django-1.4 directory
... be sure that your command-line console is in this directorycd Django-1.4
or give the full path to this file
- Launch the Python interpretor (Windows XP path):
- Verify installation and version of Django
Verify installation and version of Django¶
- Launch the Python interpretor (Windows XP path):
Start > Programs > Python 2.7 > Python (command line)
- Then, try to import Django:
>>> import django
- If there's no error message, Django is installed.
Verify the installed version:>>> django.get_version()
- You should have this output:
'1.4' ---