Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

FlaskDash starter app v1.6


This code base serves as starting point for writing your next Flask application.

It's based on the awesome work of the Ling Thio and includes the open source CoreUI admin BootStrap theme and a number of enhancements to the base Flask Starter app including adding basic user management and a separate view file for API code.

Code characteristics

  • Tested on Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7
  • Well organized directories with lots of comments
    • app
      • commands
      • controllers
      • models
      • static
      • templates
    • tests
  • Includes test framework (py.test and tox)
  • Includes database migration framework (alembic)
  • Sends error emails to admins for unhandled exceptions

Setting up a development environment

We assume that you have git and virtualenv and virtualenvwrapper installed.

# Clone the code repository into ~/dev/my_app
mkdir -p ~/dev
cd ~/dev
git clone my_app

# Create the 'my_app' virtual environment
mkvirtualenv -p PATH/TO/PYTHON my_app

# Install required Python packages
cd ~/dev/my_app
workon my_app
pip install -r requirements.txt

Configuring SMTP

Edit the file.

Specifically set all the MAIL_... settings to match your SMTP settings

Note that Google's SMTP server requires the configuration of "less secure apps". See

Note that Yahoo's SMTP server requires the configuration of "Allow apps that use less secure sign in". See

Initializing the Database

# Create DB tables and populate the roles and users tables
python init_db

# Or if you have Fabric installed:
fab init_db

Running the app (development)

# Start the Flask development web server
python runserver

# Or if you have Fabric installed:
fab runserver

Point your web browser to http://localhost:5000/

You can make use of the following users:

  • email with password Password1.
  • email with password Password1.

Running the app (production)

To run the application in production mode, gunicorn3 is used (and included in requirements.txt.

# Run the application in production mode

Running the automated tests

# Start the Flask development web server
py.test tests/

# Or if you have Fabric installed:
fab test

Using Server-side Sessions

Don't use server side session data! You should do everything you can to keep each request/response stateless. It'll be easier to maintain your code and easier to debug when something goes wrong.

However, if you really need sessions, FlaskDash has Flask-Session built in ( It is configured to use to the SQLAlchmey interface by default and the init_db command will set up a sessions table in your database. You can change your configuration to use redis or MongoDB, as well.

Sessions are available in and can be added to any additional controllers you create.

This is how you might use it:

# Session example
session['key'] = 'value'
val = session.get('key', 'not set')
val = session.get('key2', 'not set')
not set

Trouble shooting

If you make changes in the Models and run into DB schema issues, delete the sqlite DB file app.sqlite.


With thanks to the following Flask extensions:

Flask-User-starter-app was used as a starting point for this code repository.


  • Matt Hogan - matt AT twintechlabs DOT io
  • Ling Thio -- ling.thio AT gmail DOT com


Flask starter app featuring CoreUI and the FlaskUser module.








No releases published


No packages published

Contributors 4