I’ll just leave this here.
Download these files: (choose the appropriate version for your processor, etc.)
If you’d like to install pip, which is a popular package manager for Python that you may be asked to use to install many different kinds of things, also download these files:
Paths listed are the default paths when I installed these items. If you install a different version or to a different location, it’s up to you to modify the instructions accordingly.
- Install SlikSVN
- Install ActivePython 2.7
- Intall MySQL
- C:\Program Files\MySQL\MySQL Server 5.5\bin
- C:\Program Files\SlikSvn\bin
You can configure your path environment variable in Windows by going to the System control panel (Properties on Computer), Advanced, Environment Variables. Path is in the bottom pane, you’ll have to scroll down. Paths are separated by semicolons. It may be useful to copy/paste the string into a text editor to edit/verify.
Open a command prompt and type:
- cd C:\Python27\Lib\site-packages
- svn co http://code.djangoproject.com/svn/django/trunk/django
Wait a little while for svn to download Django.
Optional steps for pip installation:
CD to the location where you saved ez_setup.py and type:
ez_setup.py -U setuptools
You can delete ez_setup.py after this completes. Next, CD to the location where you extracted pip and type:
CD to the location where you’d like to store your Django project and type:
django-admin startproject newproject
This will create a subdirectory for you (called ‘newproject’), you do not need to create a directory to execute it in. Let’s set up a MySQL database:
- mysql -u root -p
- mysql> CREATE DATABASE newproject;
- mysql> exit
MySQL should prompt you for a password after the first command. Now, we’ll need to configure the Django project to use the MySQL database we created. Edit the file settings.py in newproject\newproject. Lines 14-19 contain the database configuration. Set engine to django.db.backends.mysql, name to newproject, user to root, and password to the MySQL root password. Save the file.
Back at the command prompt, verify that things are working by testing with these two commands in your project directory:
- manage.py syncdb
- manage.py runserver
The syncdb command may prompt you to configure some settings for Django administration. Runserver will run and stay running on your command prompt; press Ctrl+C to exit it. If there are no errors you will be able to access your Django webserver at http://127.0.0.1:8000/. If you’d like to change the port, just add the port number you want after runserver like so:
- manage.py runserver port
With all of that done, you should be good to move along with the Django tutorial.