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
A team blog based on Flask

A team blog based on Flask This project isn't supported at the moment, please see a newer pypress-tornado Thanks for flask_website and newsmeme at [ht

老秋 549 Nov 10, 2022
A Fast API style support for Flask. Gives you MyPy types with the flexibility of flask

Flask-Fastx Flask-Fastx is a Fast API style support for Flask. It Gives you MyPy types with the flexibility of flask. Compatibility Flask-Fastx requir

Tactful.ai 18 Nov 26, 2022
Small flask based opds catalog designed to serve a directory via OPDS

teenyopds Small flask based opds catalog designed to serve a directory via OPDS, it has currently only been verified to work with KyBook 3 on iOS but

Adam Furbee 4 Jul 14, 2022
Flask starter template for better structuring.

Flask Starter app Flask starter template for better structuring. use the starter plate step 1 : cloning this repo through git clone the repo git clone

Tirtharaj Sinha 1 Jul 26, 2022
Set up a modern flask web server by running one command.

Build Flask App · Set up a modern flask web server by running one command. Installing / Getting started pip install build-flask-app Usage build-flask-

Kushagra Bainsla 5 Jul 16, 2022
Basic flask system for login, api, and status system

Flask Multi Site With Login This is a basic website login system with an uncomplete api system NOTICE : This is NOT complete and is made to be a bare

MrShoe 0 Feb 02, 2022
A flask template with Bootstrap 4, asset bundling+minification with webpack, starter templates, and registration/authentication. For use with cookiecutter.

cookiecutter-flask A Flask template for cookiecutter. (Supports Python ≥ 3.6) See this repo for an example project generated from the most recent vers

4.3k Dec 29, 2022
A flask extension using pyexcel to read, manipulate and write data in different excel formats: csv, ods, xls, xlsx and xlsm.

Flask-Excel - Let you focus on data, instead of file formats Support the project If your company has embedded pyexcel and its components into a revenu

247 Dec 27, 2022
Implement Instagram with flask

Blue club The place where manly men live and breathe. Move to Notion Move to Fig

3 Apr 07, 2022
This repo contains the Flask API to expose model and get predictions.

Tea Leaf Quality Srilanka Chapter This repo contains the Flask API to expose model and get predictions. Expose Model As An API Model Trainig will happ

DuKe786 2 Nov 12, 2021
Full text search for flask.

flask-msearch Installation To install flask-msearch: pip install flask-msearch # when MSEARCH_BACKEND = "whoosh" pip install whoosh blinker # when MSE

honmaple 197 Dec 29, 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
Parallel TTS web demo based on Flask + Vue (Vuetify).

Parallel TTS web demo based on Flask + Vue (Vuetify).

Atomicoo 34 Dec 16, 2022
Map Matching & Weight Completion service - Java (Springboot) & Python(Flask)

Map Matching service to match coordinates to roads using Java and Springboot. Weight Completion service to fill in missing weights in a graph, using Python and Flask.

2 May 13, 2022
A Cyberland server written in Python with Flask.

Cyberland What is Cyberland Cyberland is a textboard that offers no frontend. Most of the time, the user makes their own front end. The protocol, as f

Maxime Bouillot 9 Nov 26, 2022
A boilerplate Flask API for a Fullstack Project :rocket:

Flask Boilerplate to quickly get started with production grade flask application with some additional packages and configuration prebuilt.

Yasser Tahiri 32 Dec 24, 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
Connect is a Python Flask project within the cloud-native ecosystem

Connect is a Python Flask project within the cloud-native ecosystem. Second project of Udacity's Cloud Native Nanodegree program, focusing on documenting and architecting a monolith migration to micr

Lauren Ferreira 3 Feb 28, 2022
Forum written for learning purposes in flask and sqlalchemy

Flask-forum forum written for learning purposes using SQLalchemy and flask How to install install requirements pip install sqlalchemy flask clone repo

Kamil 0 May 23, 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