Skip to content

Twelve-Factor Flask application

Notifications You must be signed in to change notification settings

nickelwound/teela

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teela

A Flask bootstrap and application skeleton with twelve-factor principles.

Bootstraps a typical Flask application with authentication, SQL database, forms and caching. Constructed of modular apps separating data modules, HTML-based views, JSON-based API responses and an authentication-protected admin interface.

Includes an example model for the purpose of demonstration SQL querying and basic CRUD admin actions. Basic templates and static file structure also in place.

Dependencies

Getting started

  1. Install requirements (use virtualenv)

     $ pip install -r requirements.txt
    
  2. Initialise database with Fabric

     $ fab setup
    
  3. Run with Fabric

     $ fab run
    

Application and environment configuration

Honcho adds the contents of .env file as environment variables. The application boostrap configures Flask using these settings, so edit this file as you please - see Flask configuration.

Note: Defaults are defined in the config class for some settings, so you don't need to duplicate these in your .env if you want to keep it minimal. Currently SERVER_NAME (which is used to determine the application HOST and PORT), SQLALCHEMY_DATABASE_URI and SECRET_KEY are the only required settings.

Obviously, SECRET_KEY should be something considerably stronger than the example.

Running locally

To run with Flask's development server, use:

$ fab dev

Set DEBUG=True in your .env file to auto-reload with code changes. See the fabfile for other commands.

See also:

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License

About

Twelve-Factor Flask application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.7%
  • CSS 3.3%