4 examples of 'flask run port' in Python

Every line of 'flask run port' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
71def _run_flask(self, host, port, debug=False, using_win32=False):
72 print host
73 if using_win32:
74 import pythoncom
75 pythoncom.CoInitialize()
76 self.flask_app.run(debug=debug, host=host, port=port,
77 use_reloader=False)
122def run_default_server(app, port):
123 servers["werkzeug"](app, port, server_host)
70def run_flask(self):
71 """
72 Run flask or other framework specified
73 """
74 if isinstance(self.server, str):
75 if self.server.lower() == "flask":
76 self.flask_app.run(host=self.host, port=self.port)
77 elif self.server.lower() == "django":
78 if sys.platform in ['win32', 'win64']:
79 os.system("python manage.py runserver {}:{}".format(self.host, self.port))
80 else:
81 os.system("python3 manage.py runserver {}:{}".format(self.host, self.port))
82 else:
83 raise Exception("{} must be a function which starts the webframework server!".format(self.server))
84 else:
85 self.server()
79@click.option('--port', default=5000)
80@click.option('--debug', default=False)
81def run(port, debug):
82 # run the web application with the appropriate configuration
83 app.run(debug=debug, port=port)

Related snippets