#!/usr/bin/python # -*- coding: UTF-8 -*- from myapp import application application.run(host="0.0.0.0", port=5000)
#!/usr/bin/env python import sys, os # get directory where this script resides scripts = os.path.dirname(os.path.realpath(__file__)) # direct Flask to use this virtualenv (all its packages) project_dir = os.path.abspath(scripts + '/../private') activate_this = '%s/bin/activate_this.py' % project_dir execfile(activate_this, dict(__file__=activate_this)) sys.path.append(project_dir) # update sys.path so Python finds the myapp package sys.path.append(scripts) # grab the application object from myapp import application if __name__ == "__main__": application.run()
from myapp import application if __name__ == "__main__": application.run()
from myapp import application if __name__ == '__main__': application.run(host='0.0.0.0', port=5000)
from myapp import application application.run(host='localhost', port=8080, debug=True)