django-admin.py on win7 asked programm for open
I have installed Django on Win7 and try
>>> import django
>>> django.VERSION
(1, 2, 3, 'final', 0)
it works. But when I call django-admin.py startproject myappname, Windows show me dialog with ask what program it should use to open this command. If I check python.exe then django-admin.py always show me help about dja开发者_运维技巧ngo-admin.py
Windows show me dialog with ask what program it should use to open this command.
You can avoid this by using Python explicitly, provided Python.exe is in your PATH
. For e.g.
python /path/to/django-admin.py startproject myappname
.
If I check python.exe then django-admin.py always show me help about django-admin.py
From the documentation for django-admin.py startproject
:
This command is disabled when the
--settings
option todjango-admin.py
is used, or when the environment variableDJANGO_SETTINGS_MODULE
has been set. To re-enable it in these situations, either omit the--settings
option or unsetDJANGO_SETTINGS_MODULE
.
Can you check if you have set an environment variable named DJANGO_SETTINGS_MODULE
? If yes, remove/unset it and try again.
I have had the same problen that raise this error when I ran django-admin.py on Command prompt I couldn't create a projects. I tried to Run Regedit by using Find to Search python.exe and then adding %% but it was not sufficient... I then added the necessary Path to the System PATH as Shown Below. (Control Panel -> System -> Advanced ->Environment Variables -> PATH). Add to the PATH C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib\site-packages\django\bin Adam It Work!!! Now I can Create Django Projects and applications Using Command on Windows 7
精彩评论