Git Product home page Git Product logo

cookiecutter-flask-minimal's Introduction

cookiecutter-flask-minimal

A microtemplate for a microframework.

This is a minimalist's production-ready Flask project template:

  • no external dependencies except for Flask and pytest
  • doesn't impose any choices of third-party libraries
  • project set-up as per Flask documentation, including things like logging and config, testing and packaging
  • optional and off by deafult: flake8, black and mypy configuration
  • optional: Poetry build tool, setuptools by defualt
  • preserves the pure joy of developing with Flask!

Now upgraded to Flask 3 !

If you look for the Flask 2 version, check out the flask2 branch. It is not actively maintained but is tested and known to work with the latest Flask 2 release (2.3.3 as of the time of this writing).

Looking for a feature-complete, yet minimalistic web app starter kit? Check out cookicutter-flask-boring.

Usage

Install cookiecutter:

pip install --user cookiecutter

Create your application from this template:

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

All set! Run the application:

cd yourapplication
make run

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

Features

Included:

  • minimal production-ready Flask application: an application factory, and a single blueprint with a sample static resource, template and an index view, packaged as as per Larger Applications

  • setuptools (or Poetry) configuration to package and release the application, as well as to develop locally

    • side note: Poetry is a popular build tool and it provides a well-structured and well-documented development environment; but, this also means that the generated project will not explain or document its usage and you would need to refer to the Poetry documentation
  • configuration system, as per Configuration Handling

  • basic Logging configuration

  • sample test and testing set-up, as per Testing Flask Applications

  • optional (and off by deafult) configuration for flake8, black and mypy

  • Makefile with a 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; it is up to you to chose how to implement your application; Patterns for Flask documents well how to easily add these if necessary

  • there are no "sample" features or examples of how to use Flask; this template is not intended as a tutorial, but as a well-configured starting point for a new implementation; refer to the Flask documentation to learn Flask if necessary

  • no choice on how to deploy the application is made, no WSGI container is chosen; see Deploying to Production for the options most suitable for your infrastructure

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.

cookiecutter-flask-minimal's People

Contributors

candidtim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cookiecutter-flask-minimal's Issues

FLASK_ENV' is deprecated

Hello ,
First of all this a wonderful agnostic cookiecutter for Flask 'by the book'
I noted the following warning on makefile run:
FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead.
I corrected it in the makefile ,replacing FLASK_ENV=development with FLASK_DEBUG=1.
It worked for me but I don't know if this 'recommended' way to do it.
Thank you very much for this repository
Olivier

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.