Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-admin.py startproject is not working

Tags:

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?

like image 306
erikvold Avatar asked Sep 09 '10 23:09

erikvold


People also ask

Why Django admin is not working?

'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.

Where is Django admin exe?

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.

How do I know if Django is installed?

Simply type python -m django --version or type pip freeze to see all the versions of installed modules including Django.


1 Answers

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> 
like image 187
user699464 Avatar answered Sep 20 '22 19:09

user699464