Skip to content

Instantly share code, notes, and snippets.

@jimdiroffii
Created September 14, 2020 14:53
Show Gist options
  • Save jimdiroffii/165bb24ae8f4dfb8e47216c5d3fdccf0 to your computer and use it in GitHub Desktop.
Save jimdiroffii/165bb24ae8f4dfb8e47216c5d3fdccf0 to your computer and use it in GitHub Desktop.
Bash script for setting up and starting a Flask application development server
#! /bin/bash
export FLASK_APP=application.py
export FLASK_DEBUG=1
export FLASK_ENV=development
export FLASK_TESTING=True
flask run --host=0.0.0.0
@jimdiroffii
Copy link
Author

jimdiroffii commented Sep 14, 2020

Run this script in your Flask application's root folder with a preceding dot to set the variables into your current environment.

~/workspace/app/ $ ls
__pycache__/  application.py  flask-dev-startup.script  helpers.py  requirements.txt  static/  templates/

~/workspace/app/ $ . ./flask-dev-startup.script

* Serving Flask app "application.py" (lazy loading)
* Environment: development
* Debug mode: on
* Running on https://localhost:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 296-555-692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment