I've a python file named "config.py" which actually checks the ip of user and run the django server on that port accordingly.
The method I used there was to create a batch file using python and execute it later.
import socket
import subprocess
x = socket.gethostbyname(socket.gethostname())
x = str(x)
with open("run.bat", "w") as f:
f.write(f'manage.py runserver {x}:0027')
subprocess.call([r'run.bat'])
But this method is not very effective. I want a way like:
import something
something.run("manage.py")
or something accordingly
Kindly Help me doing this
Edit:
I've seen Django's manage.py.
Can I edit this file (the sys.argv section) in such a way that it automatically runs a server on 192.168.x.x:8000 just by clicking on manage.py?
Please help
middlewarefor that.