A flask template with Bootstrap 4, asset bundling+minification with webpack, starter templates, and registration/authentication.

Overview

cookiecutter-flask

A Flask template for cookiecutter. (Supports Python ≥ 3.6)

Build Status CodeQL CalVer

See this repo for an example project generated from the most recent version of the template.

Use it now

Docker (This is the preferred method for creating a new project)

# Basic usage (You will be prompted to provide basic information about your application)
$ ./cookiecutter-docker.sh
    full_name [Steven Loria]:

# Additional arguments are available
$ ./cookiecutter-docker.sh --help
    Usage: ./cookiecutter-docker.sh [OPTIONS]

Options:
    -b, --build    Build Docker image before running cookiecutter
    -t, --template Specify custom cookiecutter template via a URI to a git repo
                    e.g. https://github.com/cookiecutter-flask/cookiecutter-flask.git
                    Defaults to template in current working directory
    -h, --help     Show this message and exit

Standard

If using standard instructions, Python ≥ 3.6 is required. A virtual environment is recommended (like virtualenv).

pip3 install cookiecutter
cookiecutter https://github.com/cookiecutter-flask/cookiecutter-flask.git

You will be asked about your basic info (name, project name, app name, etc.). This info will be used in your new project.

Configure and Run

After you have generated the project code, a few more steps must be taken before your new app will run. The README of the generated project shows you how to configure and run the application. (You can see the template README here).

Features

  • Bootstrap 4 and Font Awesome 4 with starter templates
  • Flask-SQLAlchemy with basic User model
  • Easy database migrations with Flask-Migrate
  • Configuration in environment variables, as per The Twelve-Factor App
  • Flask-WTForms with login and registration forms
  • Flask-Login for authentication
  • Flask-Bcrypt for password hashing
  • Procfile for deploying to a PaaS (e.g. Heroku)
  • pytest and Factory-Boy for testing (example tests included)
  • Flask's Click CLI configured with simple commands
  • CSS and JS minification using webpack
  • npm support for frontend package management
  • Caching using Flask-Cache
  • Useful debug toolbar
  • Utilizes best practices: Blueprints and Application Factory patterns

Screenshots

Home page

Home page

Inspiration

License

MIT licensed.

Changelog

Unreleased

  • Update all node dependencies to latest versions
  • Switch to using Github Actions for template CI
  • Remove support for Node 10 as a Cookiecutter option
  • Refactored Docker image to use multistage builds more efficiently
  • Projects generated with the template use Github actions for CI
  • Upgrade Webpack to 5.x

18.0.0 (09/09/2018)

  • Use CalVer (YY.MINOR.MICRO).
  • Upgrade to Bootstrap 4. Thanks @adawalli and @Hiyorim.
  • Use environment variables for configuration.
  • Add support for Pipenv.
  • Upgrade Python and Node dependencies.

0.13.0 (06/25/2017)

  • Use webpack for building front-end assets. Front-end dependencies are installed with NPM. Remove Flask-Assets and bower.json. Thanks @wroberts.

0.12.0 (11/06/2016)

  • Update Python dependencies.

0.11.1 (11/06/2016)

  • Correctly pass first parameter to Flask according to the 0.11 docs. Thanks @aliavni.
  • Remove setuptools and wheel as dependencies to fix deployment on Heroku. Thanks @Cabalist.
  • Make User.password a Binary field for compatibility with new versions of bcrypt. Thanks again @Cabalist.

0.11.0 (09/10/2016)

  • Use the FLASK_DEBUG system environment variable, instead of MYFLASKAPP_ENV, to control different configs for development and production environments

0.10.1 (08/28/2016)

  • Fix invoke test command.

0.10.0 (08/28/2016)

  • Update to Flask 0.11.
  • Use Click instead of Flask-Script for CLI commands.

0.9.0 (03/06/2016)

  • Update stale requirements.
  • Add CSRF protection.
  • Run lint command on Travis builds.
  • Test against Python 3.5.

0.8.0 (11/09/2015)

  • Update stale requirements.
  • Add lint, clean, and urls management commands.
  • Add isort.

Thanks @andreoliw for these contributions.

0.7.0 (04/14/2015)

  • Update extension import style to flask_* as per mitsuhiko/flask#1135.
  • Update stale requirements (Werkzeug, Flask-WTF, WTForms, Flask-Bcrypt, Flask-DebugToolbar, Flask-Migrate, Bootstrap, jQuery). Thanks @bsmithgall for notifying me of the critical patch to Flask-Migrate.

0.6.0 (12/01/2014)

  • Test the cookiecutter on Travis. Thanks @joshfriend.
  • Update stale requirements (Flask-WTF, Flask-Migrate, Flask-DebugToolbar)

0.5.0 (09/29/2014)

  • Fix .travis.yml.
  • Update stale requirements (Flask-WTF, WTForms, Flask-SQLAlchemy, jquery, Bootstrap)

0.4.3 (07/27/2014)

  • Add BaseFactory class.
  • Add compat.py module.
  • Tests pass on Python 3.

0.4.2 (07/27/2014)

  • Update factories to factory-boy >= 2.4.0 syntax.
  • Update stale requirements.

0.4.1 (06/07/2014)

  • Update stale requirements (Werkzeug 0.9.6, WTForms 2.0)
  • Fix unmatched div tag in home.html (thanks @level09)

0.4.0 (04/19/2014)

  • Add ReferenceCol for less verbose foreign key columns.
  • Add SurrogatePK mixin for adding integer primary key to a model.
  • Add base Model class that has CRUD convenience methods.
  • Fix setting BCrypt encryption complexity. Tests are much faster.
  • Add Role model to show ReferenceCol usage.
  • Switch to pytest.
  • Upgrade all out-of-date requirements.
  • More test examples.
  • Remove "year" from cookiecutter.json (just change LICENSE if necessary).

0.3.2 (02/26/2014)

  • Fix static assets.

0.3.1 (02/20/2014)

  • Update default year in cookiecutter.json. Thanks @Omeryl
  • Correct testing of redirects in webtests. Thanks @Widdershin
  • Fix POST action in nav form. Thanks @Widdershin.
  • Update Bootstrap (3.1.1) and jQuery (2.1.0)
  • Optional support for bower.
  • Minified assets aren't used in dev environment.

0.3.0 (12/08/2013)

  • More modular organization: each blueprint contains its own view, models, and forms in a directory. There is still a single directory for templates and static assets.
  • Use Flask-Bcrypt for password hashing.
  • Flask-Login for authentication.
  • Simple test setup. Just create a subclass of DbTestCase.
  • Flask-Testing support.
  • Use Factory-Boy for test factories.
  • Use WebTest for functional testing.
  • Add Flask-Debugtoolbar.
  • Migrations using Flask-Migrate.
  • Caching using Flask-Cache.
  • Add error page templates (404, 401, 500)
  • Add Font Awesome 4.0.3 for icons.

0.2.0 (09/21/2013)

  • Add manage.py script
  • Add Flask-Assets for CSS and JS bundling+minification
  • Use different configs for development and production environments, controlled by the MYFLASKAPP_ENV system environment variable
  • Use Blueprints and application factory pattern. The simple branch does not use these.

0.1.0 (08/20/2013)

  • First iteration
  • Bootstrap 3 final
  • Working User model and registration
Cross Origin Resource Sharing ( CORS ) support for Flask

Flask-CORS A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. This package has a simple philosoph

Cory Dolphin 803 Jan 01, 2023
Flask Multiple Database Login

Flask Multiple Database Login Handle login with flask using two diferent databases: UE | European; BR | Brazilian; These databases are separed to resp

Jose Pedro 1 Dec 16, 2021
Source code for backpainfree.org - a Q&A platform similar to StackOverFlow

Source code for backpainfree.org - a Q&A platform similar to StackOverFlow, which is designed specifically for people with back pain problems. Users can ask questions, post answers and comments, vote

Olzhas Arystanov 8 Dec 11, 2022
OpenTracing instrumentation for the Flask microframework

Flask-OpenTracing This package enables distributed tracing in Flask applications via The OpenTracing Project. Once a production system contends with r

3rd-Party OpenTracing API Contributions 133 Dec 19, 2022
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI

SAFRS: Python OpenAPI & JSON:API Framework Overview Installation JSON:API Interface Resource Objects Relationships Methods Custom Methods Class Method

Thomas Pollet 365 Jan 06, 2023
Burp-UI is a web-ui for burp backup written in python with Flask and jQuery/Bootstrap

Burp-UI Contents Introduction Screenshots Demo What's that? Who are you? Documentation FAQ Community Notes See also Licenses Thanks Introduction Scree

Benjamin 84 Dec 20, 2022
A swagger 2.0 spec extractor for flask

flask-swagger A Swagger 2.0 spec extractor for Flask You can now specify base path for yml files: app = Flask(__name__) @app.route("/spec") def spec(

Sling 457 Dec 02, 2022
Control YouTube, streaming sites, media players on your computer using your phone as a remote.

Media Control Control Youtube, streaming sites, media players on your computer using your phone as a remote. Installation pip install -r requirements.

Shreyas Daniel 10 Dec 08, 2022
Serve angular production application from python flask backend. Quick and Easy

Serve angular production application from python flask backend. Quick and Easy

mark 1 Dec 01, 2022
Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Ajay kumar sharma 5 Jun 14, 2022
Adds SQLAlchemy support to Flask

Flask-SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy

The Pallets Projects 3.9k Dec 29, 2022
This is a API/Website to see the attendance recorded in your college website along with how many days you can take days off OR to attend class!!

Bunker-Website This is a GUI version of the Bunker-API along with some visualization charts to see your attendance progress. Website Link Check out th

Mathana Mathav 11 Dec 27, 2022
Library books management program, built with Flask, Python

Library books management program, With many features and good User Interface. built with Flask, Python. (Include Screenshots) and documentation on how to run it! Thank you :)

Thierry Mugisha 1 May 03, 2022
Pagination support for flask

flask-paginate Pagination support for flask framework (study from will_paginate). It supports several css frameworks. It requires Python2.6+ as string

Lix Xu 264 Nov 07, 2022
HTTP security headers for Flask

Talisman: HTTP security headers for Flask Talisman is a small Flask extension that handles setting HTTP headers that can help protect against a few co

Google Cloud Platform 853 Dec 19, 2022
A simple way to demo Flask apps from your machine.

flask-ngrok A simple way to demo Flask apps from your machine. Makes your Flask apps running on localhost available over the internet via the excellen

117 Dec 27, 2022
A tool for the game Politics And War. Saving players hours if searching for targets they can engage with.

A tool for the game Politics And War. Saving players hours if searching for targets they can engage with.

1 Dec 19, 2021
Live Corona statistics and information site with flask.

Flask Live Corona Info Live Corona statistics and information site with flask. Tools Flask Scrapy Matplotlib How to Run Project Download Codes git clo

Mohammad Dori 5 Jul 15, 2022
Easy file uploads for Flask.

Library that works with Flask & SqlAlchemy to store files on your server & in your database Read the docs: Documentation Installation Please install t

Joe Gasewicz 145 Jan 06, 2023
Intranet de la Rez Flask web app

IntraRez Application Flask de l'Intranet de la Rez. Exigences Python : Probablement = 3.10 à terme, pour l'instant = 3.8 suffit ; Autres packages Li

3 Jul 03, 2022