startproject is not working


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

9/9/2010 11:20:07 PM

Accepted 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, 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\ startproject <project_name>
4/8/2011 11:02:01 PM

If you are running Windows for a quick fix you can create a batch file with the following values:

@echo off
@echo "Enter Proyect name"
set /p proj_name=
set building="Building django project %proj_name%"
@echo %building%
python c:/Python27/Scripts/ startproject %proj_name%

I named the file "django.bat" and to use it you can just simply add a copy in the directory you want to start the project, execute the file and it will ask you for a project name, provide one and then Voila!!

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow