erikvold erikvold - 3 months ago 12
Python Question

django-admin.py startproject is not working

after installing django I tried

django-admin.py startproject mysite
and that worked, then I got a simple site working and I wanted to start on something real, so I tried
django-admin.py startproject newsite
and nothing happened. Whenever I try the command nothing happens now.. any idea what is wrong?

Answer

For anyone stumbling across this now, this problem is a result of Windows not obeying the #!C:\Path\To\Virtualenv\Scripts\Python.exe hashbang at the top of django-admin.py, and therefore running it with the wrong python.exe (evidently a virtualenv bug).

However, with virtualenv active, you can use the following command, which will result in the correct python being used, and everything being ok:

python C:\Path\To\Virtualenv\Scripts\django-admin.py startproject <project_name>
Comments