Raviv
Raviv

Reputation: 11

creating windows batch to run django server

I want to define django virtualenv, then operate the server. but I want it in one operation, not 2. so, I tried to write batch. my batch is:

start workon moviesEngine 

timeout 2
start python manage.py runserver

but it not success. it create a new cmd for the workon (i.e the virtualenv I want to work with), and operate the python command in different cmd (which hasn't the support of the virtualenv).

how do I force the python command to run in the new cmd with the virtualenv?

Upvotes: 0

Views: 970

Answers (2)

Peter Nanii
Peter Nanii

Reputation: 33

Do both of them simultaneously

workon movies_engine && python manage.py runserver

Upvotes: 0

303
303

Reputation: 4732

You can use the /b option of the start command to start another application without creating another window.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

B           Start application without creating a new window. The
            application has ^C handling ignored. Unless the application
            enables ^C processing, ^Break is the only way to interrupt
            the application.

Upvotes: 1

Related Questions