Giter Site home page Giter Site logo

gmolveau / flask-sqlalchemy-heroku Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 4.0 118 KB

Easily edit and deploy a Flask based app with sqlalchemy and postgresql on Heroku with this boilerplate

License: MIT License

Python 96.53% HTML 2.30% Shell 1.17%
heroku flask flask-sqlalchemy flask-application postgresql messenger-bot boilerplate skeleton python python3

flask-sqlalchemy-heroku's Introduction

Flask + SQLAlchemy + Heroku

A boilerplate for a flask based app with sqlalchemy and postgresql -> deploy easily on heroku

Deploy

Getting started

Install the app

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt

Dev mode

Copy the .env.example to .env.

The default URL for the database should work by default.

Run the database + adminer :

docker-compose -f docker-compose.dev.yml up -d

Reset the database :

flask reset_db

Explore the database :

  • go to http://localhost:8123
    • System = Postgresql
    • Server = db # name of the service in the docker-compose
    • Username =
    • Password =
    • Database = <database_name>

Launch the app

FLASK_ENV=development flask run

Try to visit http://localhost:5000/api/v1/

Heroku

https://devcenter.heroku.com/articles/getting-started-with-python

Run locally

# with the heroku toolbelt installed : https://devcenter.heroku.com/articles/heroku-cli
heroku local

Task scheduling

Schedule a task for free every 10 minutes, every hour, or every day with heroku-scheduler :

Scheduler

Todo

  • Use flask-migrate (alembic)

flask-sqlalchemy-heroku's People

Contributors

dependabot[bot] avatar gmolveau avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  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.