I am trying to start a new django project (using django-admin.py ), but unfortunately I always get the following error:
C:\Users\NAME\dev\django>django-admin.py startproject foo Usage: django-admin.py subcommand [options] [args] [...]
The same applies to any other django-admin.py command - each command does not exist.
I already have django projects (in C:\Users\NAME\dev\django\blog ) and I know that the startproject command is disabled if DJANGO_SETTINGS_MODULE set, but when I try this:
>>> import os >>> os.environ['DJANGO_SETTINGS_MODULE'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python26\lib\os.py", line 423, in __getitem__ return self.data[key.upper()] KeyError: 'DJANGO_SETTINGS_MODULE'
Or even better:
>>> from django.conf import settings >>> dir(settings) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python26\lib\site-packages\django\utils\functional.py", line 306, in __dir__ self._setup() File "C:\Python26\lib\site-packages\django\conf\__init__.py", line 38, in _set up raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SE TTINGS_MODULE is undefined.
DJANGO_SETTINGS_MODULE seems to be undefined. Does anyone have an idea why I can't use django-admin.py ?
Django 1.2.3, Windows 7 (64 bit)
Nedec source share