A Python script that activates the virtualenv and then runs another Python script? A Python script that activates the virtualenv and then runs another Python script? python python

A Python script that activates the virtualenv and then runs another Python script?


You can activate your virtualenv and then start server using a bat file.Copy this script in to a file and save it with .bat extension (eg. runserver.bat)

@echo offcmd /k "cd /d C:\Users\Admin\Desktop\venv\Scripts & activate & cd /d    C:\Users\Admin\Desktop\helloworld & python manage.py runserver"

Then you can just run this bat file (just double click) to start the server


runserver.bat:

 CALL [your path]\Scripts\activate.bat python manage.py runserver


If you want call virtualenv'ed Python directly you can do something like this:

 C:\Users\Admin\Desktop\venv\Scripts\bin\python.exe manage.py runserver

Double check python.exe location on your virtualenv folder - don't remember how it is out of my head. This Python associates itself with the virtualenv and uses its site-packages by default.