Skip to content

Cookicutter template for minimal production-ready Flask project

Notifications You must be signed in to change notification settings

Sysvale/cookiecutter-flask-minimal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

flask-minimal

This is a minimal Flask project, with no external dependencies except for Flask itself. It doesn't impose how to implement the web application, but it is ready for production deployment from the start.

Usage

Install cookiecutter:

pip install --user cookiecutter

Create your application from this template:

cookiecutter https://github.com/Sysvale/cookiecutter-flask-minimal.git

All set! Run the application:

docker-compose up [service_name]

And then open it at http://0.0.0.0:5000/

Features

Included:

  • minimal production-ready Flask application: root package, sample static resource, sample template and an index view, as per Larger Applications

  • setuptools configuration to package and release the application, as well as to develop locally, as per Deploying with Setuptools

  • configuration system, as per Configuration Handling

  • basic logging configuration, as per Logging to a File

  • sample test and configuration necessary to run the tests, as per The Testing Skeleton

  • Makefile with few typical tasks automated (see generated README for details)

Not included:

  • everything else: there is no SQLAlchemy, or MongoKit, or Bootstrap CSS, or React, or whatever else here; it is up to you to chose how to implement your application

  • no choice on how to deploy the application is made, no WSGI container is chosen; if you are interested in an out-of-the-box deployment automation, check out accompanying cookiecutter-flask-ansible; see generated README for more ideas about deployment

Contributions

... are welcome! Feel free to create a pull request to fix bugs or keep up to date.

If you think some additional feature is indispensable, feel free to create an issue or a pull request, but bare in mind that the goal of this template is to stay a "minimal" one. If you would like to add a feature, maybe best way to do so is to make it optional and off by default then. One can use cookiecutter's choice variables, and, ultimately, hooks, in order to create an optional feature.

If you do a change, use make test from root directory to test the updated template.

Attributions

Configuration of this entire project template is based on Flask documentation. Please, note however, that this template is not guaranteed to follow Flask documentation precisely.

Possible future improvements

  • add optional configuration for e-mail error reporting and/or Sentry
  • add choice for testng framework (and also make it entirely optional)
  • find a cross-platform replacement to a Makefile

About

Cookicutter template for minimal production-ready Flask project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 65.3%
  • Dockerfile 22.7%
  • HTML 7.6%
  • Makefile 3.7%
  • CSS 0.7%