The first thing we need to do is download some software:
Postgresql
SVN
Python
MX-Extensions
Win-Pyscopg
Postgresql
Go to http://wwwmaster.postgresql.org/download/mirrors-ftp and pick the location closest to you.
You will need to download the win32 version of Postgres with the installer. At time of writing the file was called "postgresql-8.2.4-1.zip".
SVN
Because Django is always under heavy development it is advisable to install SVN so you can regularly update your copy of django easily.
You can get SVN from here: http://subversion.tigris.org/servlet...st?folderID=91
Get the latest version. At time of writing this was called "svn-1.4.5-setup.exe".
Python
You can get Python from here: http://www.python.org/download/
Download the Python 2.5.1 (or latest version) Windows installer.
MX-Extensions
Go here: http://www.egenix.com/products/python/
Click on the eGenix.com mx Base Distribution link.
Scroll down the next page to the downloads section. Here you should download the version that matches your Python version.
Win-Psycopg
You can get win-psycopg here: http://stickpeople.com/projects/python/win-psycopg/
Download the version that matches your Python version. Because I'm using Python 2.5.x I downloaded "win-psycopg25.zip".
Installation
Postgresql
Extract the Postgres zip to your desktop.
In order to install Postgres on Vista and not have to disable UAC, click from the start menu:
Start > Programs > Accessories.
Right click the Command Prompt shortcut and click "Run as Administrator", and then click "Continue" when prompted.
Navigate to your desktop folder.
Code:
cd c:\users\your username\Desktop
Code:
postgresql-8.2.msi
SVN
Run the SVN exe. It should by default install to C:\Program Files\Subversion or C:\Program Files (x86)\Subversion for 64bit Vista users.
Python
Run the Python MSI. When I install Python I always install to C:\Python. It is important that you remember here where you install Python to.
MX-Extensions
Run the MX-Extensions MSI. It will ask you where to install it. This should be installed into your Python folder. ie. C:\Python (if you followed my preference).
Win-psycopg
Unzip the win-psycopg zip file to your desktop. Copy both the libpq.dll and pyscopg.pyd files into your Python\DLLs folder.
Important note on PATHs
Both Python and its scripts folder needed to be added to your PATH variable.
Hold down the Windows Key and press Pause Break.
Click the "Advanced System Settings" option from the sidebar of the window and continue on the following dialogue box.
Click on the "Environmental Variables" button.
From the 2nd Window that is entitled "System Variables" scroll down until you see Path.
Double click on PATH. A box will come up detailing the locations currently in your PATH variable.
Scroll to the end of that list and add the following:
Code:
;c:\Python\Scripts;c:\python
Please also note that you must alter the locations above if you chose not to install python as I have. For example it may need to be:
Code:
;c:\Python25\Scripts;c:\python25
If your PATH variable already has a ; at the end you do not need to add it.
This is my PATH variable for example:
Quote:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Sy stem32\Wbem;C:\Program Files (x86)\Subversion\bin;c:\Python\Scripts;c:\python
Install Django
Close any command prompt windows you have open. Command prompt windows need to be closed and reopened after PATH changes.
Open up a command prompt (Start > Run > type "cmd" hit enter). Note that this command prompt does not require administrative priviledges.
Traverse to C:\
Code:
cd \
Code:
svn co http://code.djangoproject.com/svn/django/trunk/ django_src
Now CD to the django_src folder.
Code:
cd django_src
Code:
python setup.py install
Code:
cd \
Code:
mkdir django
Code:
cd django
Code:
django-admin.py startproject testproject
Code:
cd testproject
Code:
python manage.py runserver
Quote:
Validating models...
0 errors found.
Django version 0.97-pre-SVN-unknown, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
0 errors found.
Django version 0.97-pre-SVN-unknown, using settings 'myproject.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
You should be greeted with:
Quote:
It worked!
Congratulations on your first Django-powered page.
Congratulations on your first Django-powered page.
No comments:
Post a Comment