Skip to content

An opinionated boilerplate for web development with Flask.

License

Notifications You must be signed in to change notification settings

tonymontaro/flask-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov Maintainability

flask-starter-kit

An opinionated boilerplate for web development with Flask, helping you stay productive while following best practices.

Technologies Used

  • Python3.6 - A programming language that lets you work more quickly.
  • Flask - A microframework for Python based on Werkzeug, Jinja 2 and good intentions.
  • Virtualenv - A tool to create isolated virtual environments.

Extentsions

Getting Started

Requirements

  • Mac OS X, Windows or Linux
  • Python 3.6
  • Virtualenv

How to Use

  • Start by creating a new project and initiate a git repository:
mkdir myproject && cd myproject
git init
  • Pull the content of this repository into your project's repo:
git pull https://github.com/tonymontaro/flask-starter-kit.git
  • Create and activate a virtual environment in python3:
virtualenv -p python3 venv && source venv/bin/activate
  • At this point, you can finish the installation with the command: make install

or simply proceed with the remaining steps below.

  • Create a .env file and copy over content from the file env_sample on the root directory. In the .env file, you can specify things like the Database URL (the app uses sqlite by default but this behavior can be over-ridden here with something like postgres).
cp env_sample .env
  • Install the dependencies:
pip install -r requirements.txt
  • Migrations; run the following commands in order:
flask db init
flask db migrate
flask db upgrade

When a change is made to the models, the last two commands (migrate and upgrade) will need to be run.

  • Finally, run the application
flask run

Tests

  • Run the tests with:
pytest

Tests with coverage

  • Show test coverage on the console: pytest --cov=app
  • Generate html files containing test coverage: pytest --cov=app --cov-report=html

Api hosted on Heroku.

Api documentation: Generated with Postman

License

MIT

About

An opinionated boilerplate for web development with Flask.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published