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

前端 未结 5 994
别跟我提以往
别跟我提以往 2020-12-04 10:19

On Windows Vista, I need a script that starts the activate (to activate the virtualenv) script in:

C:\\Users\\Admin\\Desktop\\venv\\Scripts         


        
5条回答
  •  执笔经年
    2020-12-04 10:57

    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 off
    cmd /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

提交回复
热议问题