I am trying to create a python script to auto-run all my Django commands,
but the script execution stops at os.system('python manage.py runserver')
and does not run the next line because os.system('python manage.py runserver')
needs to keep running. How do I run the next line of code while os.system('python manage.py runserver')
is still running?
I tried using the python sleep method to wait a few seconds and then run the next line, but it did not work.
Here is my code:
import os, webbrowser, time
os.system('pipenv shell')
os.system('python manage.py runserver')
time.sleep(5)
webbrowser.open('http://127.0.0.1:8000', new=1, autoraise=True)
The execution stops at os.system('python manage.py runserver')
but I want it to run webbrowser.open('http://127.0.0.1:8000', new=1, autoraise=True)
while os.system('python manage.py runserver')
is still running.