Commit b073e7cd authored by Emanuele Santoro's avatar Emanuele Santoro

Better integration with gunicorn

parent d0b0245c
# web: python3 musho.py
# web: gunicorn musho:musho --preload -b 0.0.0.0:$PORT --log-file -
web: python3.4 musho.py
web: gunicorn musho:musho --preload -b 0.0.0.0:$PORT --log-file -
\ No newline at end of file
......@@ -38,17 +38,18 @@ def resolveLink(link_id):
else :
return redirect("/")
debug = os.getenv("DEBUG", None)
if debug is not None :
musho.debug = True
port = 9000
try :
port = int(os.getenv("PORT", "9000"))
except :
pass
musho_url = os.getenv("MUSHO_URL", "http://localhost:%d" % port)
print("MUSHO_URL:\t\t%s" % musho_url)
print("PORT:\t\t\t%d" % port)
print("DEBUG:\t\t\t%s" % debug)
if __name__ == "__main__" :
debug = os.getenv("DEBUG", None)
if debug is not None :
musho.debug = True
port = 9000
try :
port = int(os.getenv("PORT", "9000"))
except :
pass
musho_url = os.getenv("MUSHO_URL", "http://localhost:%d" % port)
print("MUSHO_URL:\t\t%s" % musho_url)
print("PORT:\t\t\t%d" % port)
print("DEBUG:\t\t\t%s" % debug)
musho.run(port=port)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment