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

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
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
A simple Task todo application built with Flask

Task TODO Table An application built with Flask a Python framework and hosted on Heroku. Important notes GuniCorn (Green Unicorn): is a Python WSGI HT

DCN (Dubem Celestine Nwabuisi) 1 Dec 15, 2021
SeCl - A really easy to deploy and use made-on Flask API to manage your files remotely from Terminal

SeCl SeCl it's a really easy to deploy and use made-on Flask API to manage your

ZSendokame 3 Jan 15, 2022
A service made with Flask and Python to help you find the weather of your favorite cities.

Weather-App A service made with Flask and Python to help you find the weather of your favorite cities. Features Backend using Flask and Jinja Weather

Cauã Rinaldi 1 Nov 17, 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
Getting Started with Docker and Flask

Getting-Started-with-Docker-and-Flask Introduction Docker makes it easier, simpler and safer to build, deploy and manage applications in a docker cont

Phylis Jepchumba 1 Oct 08, 2021
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
Simple flask api. Countdown to next train for each station in the subway system.

Simple flask api. Countdown to next train for each station in the subway system.

Kalyani Subbiah 0 Apr 17, 2022
Flask-template - A simple template for make an flask api

flask-template By GaGoU :3 a simple template for make an flask api notes: you ca

GaGoU 2 Feb 17, 2022
A live chat built with python(flask + gevent + apscheduler) + redis

a live chat room built with python(flask / gevent / apscheduler) + redis Basic Architecture Screenshot Install cd /path/to/source python bootstrap.py

Limboy 309 Nov 13, 2022
A Flask application for Subdomain Enumeration

subdomainer-flask A Flask application for Subdomain Enumeration steps to be done git clone https://github.com/gokulapap/subdomainer-flask pip3 install

GOKUL A.P 7 Sep 22, 2022
Flask Project Template A full feature Flask project template.

Flask Project Template A full feature Flask project template. See also Python-Project-Template for a lean, low dependency Python app. HOW TO USE THIS

Bruno Rocha 96 Dec 23, 2022
Flaskr: Intro to Flask, Test-Driven Development (TDD), and JavaScript

Flaskr - Intro to Flask, Test-Driven Development, and JavaScript Share on Twitter As many of you know, Flaskr -- a mini-blog-like-app -- is the app th

Michael Herman 2.2k Jan 04, 2023
Lightweight library for providing filtering mechanism for your APIs using SQLAlchemy

sqlalchemy-filters-plus is a light-weight extendable library for filtering queries with sqlalchemy. Install pip install sqlalchemy-fitlers-plus Usage

Karami El Mehdi 38 Oct 05, 2022
Flask Application Structure with MongoDB

This application aims to serve as a template for APIs that intend to use mongoengine and flask-restx

Tiago Franco 5 Jun 25, 2022
i18n and l10n support for Flask based on Babel and pytz

Flask Babel Implements i18n and l10n support for Flask. This is based on the Python babel module as well as pytz both of which are installed automatic

397 Dec 15, 2022
Force SSL on your Flask app.

Flask-SSLify This is a simple Flask extension that configures your Flask application to redirect all incoming requests to HTTPS. The extension is no l

Kenneth Reitz 26 Dec 07, 2022
WebSocket support for Flask

flask-sock WebSocket support for Flask Installation pip install flask-sock Example from flask import Flask, render_template from flask_sock import Soc

Miguel Grinberg 165 Dec 27, 2022
Harmony, a discord clone, allows users to chat with other users in real time via servers, channels, and direct messages

Harmony, a discord clone, allows users to chat with other users in real time via servers, channels, and direct messages

Seth Holland 3 Feb 03, 2022
Python web-app (Flask) to browse Tandoor recipes on the local network

RecipeBook - Tandoor Python web-app (Flask) to browse Tandoor recipes on the local network. Designed for use with E-Ink screens. For a version that wo

5 Oct 02, 2022