I hope this helps, when working under windows (XP/7) this just works for me.
Replace <project> with whatever you have named it.
From the directory above where the project was created create a batch file (ie <project>.bat) containing the following
set <project>_HOME=%CD%
set DJANGO_SETTINGS_MODULE=<project>.settings
set PYTHONPATH=%<project>_HOME%
You can add any other additional pythonpath requirements with the delimiter of a semicolon ‘;’
You could also hardcode the “<project>_HOME” variable, but this is up to you
Once done the following should work for you via the command prompt.
Run the batch file above from the directory it was created in
<project>
cd <project>
manage.py shell
On Tuesday, 28 August 2012 09:01:25 UTC+10, Snorre Edwin wrote:Im on the Playing with the API part and seem to catch some troubles.Everything has gone smoothly until this part.I write this and get the next error. This is with my enviromen_variable: DJANGO_SETTINGS_MODULE set to where I can find the settings.py in my project.C:\Prosjekter\Djangotest\testproject>python manage.py shellImportError: Could not import settings 'C:\Prosjekter\Djangotest\testproject\testproject' (Is it on sys.path?): Import by filename is not supported.With out the env variable I get this error:C:\Prosjekter\Djangotest\testproject>python manage.py shellImportError: No module named userI have done the sync part and I can see that the postgreSQL have the tables in its database.I have also done everything right until this part.As i understood, I did not have to set env variable when I used python manage.py shell.Can someone help me please:)
It makes sense, since my guess is that you have Python 3.2 installed.
Django 1.4 does not support python 3.x, only 2.5 through 2.7. Django 1.5
will be the first release supporting Python 3.x.
--
Melvyn Sopacua