I have finished working on Django project, but I don't want to Deploy it to the server right now I want to use this system on my local host. I tried to create a file with bat extension, and this one is to open the project on the Chrome browser This file will work when opened The question is how with this file can I run the project virtual environment
The code that works is 'manager.bat':
start cmd /k start chrome http://127.0.0.1:8000/admin/
cd manager/venv/Manager
python manage.py runserver
But when adding this statement:
activate
Then, when executing the file again, it exits the cmd without executing anything
Code not working:
start cmd /k start chrome http://127.0.0.1:8000/admin/
cd manager/venv
cd Scripts
activate
cd ..
cd Manager
python manage.py runserver
[This is on cmd and it works][1] [1]: https://i.stack.imgur.com/k5XIe.png
Open Notepad and Write the following code, also change directory name as your need and save it as ***.bat file in your desktop
@echo off
cmd /k "cd /d E:\ProjectsFolder\projectenv\Scripts & activate & cd /d E:\ProjectsFolder\projectenv\myproject & python manage.py runserver"
Maybe this link help you to Activate environment, run the project then open the browser.
try to follow it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.