"""Usage: run.py [--host=<host>] [--port=<port>] [--debug | --no-debug] --host=<host> set the host address or leave it to 0.0.0.0. --port=<port> set the port number or leave it to 5500. """ from weather import app if __name__ == '__main__': from docopt import docopt arguments = docopt(__doc__, version='0.1dev') host = arguments['--host'] port = arguments['--port'] debug = not arguments['--no-debug'] if not port: port = 5500 if not host: host = '0.0.0.0' app.run(debug=debug, host=host, port=int(port))
from weather import app if __name__ == "__main__": app.run()
from weather import app import os from os import path extra_dirs = ['./weather/templates', './weather/static'] extra_files = extra_dirs[:] for extra_dir in extra_dirs: for dirname, dirs, files in os.walk(extra_dir): for filename in files: filename = path.join(dirname, filename) if path.isfile(filename): extra_files.append(filename) if __name__ == '__main__': app.run(debug=True, extra_files=extra_files)
import os from weather import app if __name__ == "__main__": # app.run(debug=True) # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT', 5000)) app.run(host='0.0.0.0', port=port)
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Runserver --------- This module is used to run the application with Flasks built in WSGI server. Should NOT be used in production. """ from weather import app if __name__ == "__main__": app.run(debug=True, use_reloader=True)
from weather import app app.run(host="0.0.0.0",port="8080")
from weather import app, views if __name__ == "__main__": app.run(debug=True)
from weather import app if __name__ == '__main__': app.run(debug=True, port=5001) #run app in debug mode on port 5001