Giter Club home page Giter Club logo

flask-boilerplate's Introduction

Actual readme for this project:

To make this template fit your app, replace the following

  • {{APP_NAME}} -> App Name
  • {{APP_SLUG}} -> app-name
  • {{APP_BLURB}} -> Here is a quick blurb about the app

TODO:

  • emailing
  • redis caching

=====================

{{APP_NAME}}

{{APP_BLURB}}

Install python dependencies

This project assumes you already have virtualenv, virtualenvwrapper and autoenv installed globally on your system.

First, create a new virtual environment:

mkvirtualenv {{APP_SLUG}}

Then, install the required python dependencies

pip install -r requirements.txt

Setup local postgres database

Create the database locally

psql -h localhost -d postgres

psql (9.4.4)
Type "help" for help.

postgres=# CREATE DATABASE {{APP_SLUG}};
CREATE DATABASE

Run your local server

Ensure that the local .env file has been applied, then run

python app.py

or alternatively, use gunicorn

gunicorn app:app --reload --bind 127.0.0.1:5000

Run database migrations

Detect changes to models.py and generate a timestamped migration file

python manage.py db migrate

Once you've looked over the generated migrations file, apply the migration to your local database

python manage.py db upgrade

Testing

You'll need to set up a separate postgres database for testing

psql -h localhost -d postgres

psql (9.4.4)
Type "help" for help.

postgres=# CREATE DATABASE {{APP_SLUG}}_test;
CREATE DATABASE

To run the tests

python test.py

Deploying

To push code changes to heroku

git push heroku master

To run database migrations on heroku

heroku run python manage.py db upgrade

Make sure you run this immediately after deploying any code that includes database migrations.

flask-boilerplate's People

Contributors

hartleybrody avatar

Watchers

 avatar

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.