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?
'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.
For windows, the "django-admin" you need to create a project is an .exe file not a . py file and it is present at the following location: C:\Python27\Scripts so you have to add this location to your path.
Simply type python -m django --version or type pip freeze to see all the versions of installed modules including Django.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With