tags:

views:

56

answers:

2

Hi, i really need a code sample to automate starting Django development webserver "python manage.py runserver" in a .bat file in windows . I have python26 and django 1.1.1 in installed

Thanks

i meant by automate is clicking on the .bat file and the Django development webserver start up and i have no batch file scripting knowledge will love to get a code sample

+2  A: 

You can write a .bat file containing:

cd <location of your django project>
<location of python.exe> manage.py runserver

I believe that should suffice.

Miguel Ventura
yes but i have no batch file scripting knowledge
Spikie
hi miguel i will really love to have a code example
Spikie
The code is just like that... all you have to do is replace what's inside the <>s. Location of python.exe should be something like `"C:\Program Files\Python\python-2.6.1\python.exe"` but will depend on your installation. Similarly, django project location is the folder where your django project is.
Miguel Ventura
A: 

As Miguel said, you can write the below lines:

cd <location of your django project>

<location of python.exe> manage.py runserver

in a file and save it as somefilename.bat, thats it. Now, its a batch file and clicking on it would execute it i.e. your runserver command.

What do you mean by batch file scripting?

Ankit Jaiswal