Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Prevent preparing twice when in dev mode due to reloader
if not self.debug or in_reloader:
self.prepare_server()
print("Starting server.")
# Run the development server
if self.debug:
call_command("runserver", "0.0.0.0:8000")
return
import pyuwsgi
# Run uwsgi for production server
pyuwsgi.run(["--ini", "docker/uwsgi.ini"])
orig_args = sys.argv
orig_executable = sys.executable
orig_args.insert(0, orig_executable)
uwsgi_args = []
uwsgi_args.append('--socket')
uwsgi_args.append(':3031')
#uwsgi_args.append('--master')
uwsgi_args.append('--module')
#uwsgi_args.append('welcome')
uwsgi_args.append('hello')
#pyuwsgi.run('welcome.ini')
pyuwsgi.run(uwsgi_args)
# if you are here uWSGI has been reloaded
os.execv(orig_executable, orig_args)
"virtualenv": sys.prefix,
"wsgi_env_behavior": "holy",
}
options.setdefault("%s_socket" % options["protocol"], bind)
options.update(kwargs)
prepare_environ(options, os.environ)
try:
import pyuwsgi
except ImportError:
os.execvp("uwsgi", ("uwsgi",))
else:
pyuwsgi.run([])