views:

54

answers:

1

I'm having trouble installing Django, even if I follow the instructions here: http://www.djangobook.com/en/2.0/chapter02/

Could someone please provide baby steps to installing Django. I'm talking baby steps that really break it down, so that a retarded person could do it.

I've installed Django and unzipped the file, but I'm unsure where to go from there.

I on Windows 7, and I've downloaded Python 2.7 and Django 1.2.1.

+3  A: 

OK. If you have Python installed, you can then proceed to execute setup.py given with Django. Head over to the directory where you unzipped Django.

cd C:\path\to\Django\

You can now execute

python setup.py install

This step requires your python executable to be present in the system's PATH environment variable. If it isn't you will have to append your Python installation directory to your PATH.

Update

You can verify that the installation has gone well with the following command. Run python and execute the command import django. If no import errors are thrown everything is OK. Thanks to cji for the tip.

Manoj Govindan
You were faster :) I would mention the way to validate instalation: run python.exe and try `import django`.
cji
Nice tip. I am editing my answer to add it. Thanks!
Manoj Govindan
something's not working. Do I type python setup.py install into the command prompt or IDLE? Also, where should I put the Django folder? Within the python folder? Do I add's the django directory to the PATH environment variable? I'm confused. What's the python executable?
Justin Meltzer
@Justin in the command prompt. Everything else is irrelevant - `setup.py` will copy Django files to where they should be automatically, no matter where they were. 'python executable' is simply `python.exe` (on Windows).
cji
@Justin: (1) You should type `python setup.py install` into the _command prompt_. You are executing **python.exe** with two arguments here. (2) There is no requirement on where the Django folder should be. In fact you can safely delete it _after_ you install Django. (3) you **do not** have to add Django directory to the PATH variable, only the Python installation directory (if you haven't already done so) (4) Python executable is the **python.exe** file that is present in the Python installation directory.
Manoj Govindan
So I type python setup.py install into the command prompt and I get a SyntaxError. I get SyntaxError: invalid syntax with a "^" pointing to the "p" in "setup".
Justin Meltzer
And when I type import django I get an error saying that the module doesn't exist. What am I doing wrong?
Justin Meltzer
@Justin: Looks like you may have got Python REPL and windows command line mixed up. (1) Did you type `python setup.py install` and `import django` into the _same_ shell/command line? if you **did**, then it is a mistake (2) Can you post a screenshot of whatever you are trying?
Manoj Govindan
I'm having trouble posting a screenshot to SO. Could you send me your email so I could mail it to you?
Justin Meltzer
thanks, just emailed you
Justin Meltzer
@Justin: reply is on its way.
Manoj Govindan