Skip to content

Instantly share code, notes, and snippets.

@devhero
Last active August 16, 2021 09:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devhero/bc0789e0ebcfcce457c3e59f5232389f to your computer and use it in GitHub Desktop.
Save devhero/bc0789e0ebcfcce457c3e59f5232389f to your computer and use it in GitHub Desktop.
flask tips
# from http://flask.pocoo.org/docs/1.0/cli/
# Setting Command Options
# Click is configured to load default values for command options from environment variables. The variables use the pattern FLASK_COMMAND_OPTION. For example, to set the port for the run command, instead of flask run --port 8000:
export FLASK_RUN_PORT=8000
flask run
* Running on http://127.0.0.1:8000/
# These can be added to the .flaskenv file just like FLASK_APP to control default command options.
# .flaskenv example
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
FLASK_APP=app_dev.py
FLASK_ENV=development
FLASK_RUN_HOST=localhost
FLASK_RUN_PORT=5050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment