I have a flask application which I am currently starting up in the following way:
#phantom.py
__author__ = \'uruddarraju\'
from phantom.api.v1 import app
app.run
Probably the best way to do this is behind nginx like @RaphDG answered, But if you want to run it in the background for personal use I found that the logging system would not let you to use only with "&" at the end of the command line, in addition i found that the logger is internal logger of Werkzeug library.
To get around this you can do the next steps(code below):
It will evade notifications and loggers and let you run this process in the background (with "&")
code:
import werkzeug._internal
def demi_logger(type, message,*args,**kwargs):
pass
the first line in the __main__:
werkzeug._internal._log = demi_logger