Skip to content

Yomudogly/Sample-Flask-API

Repository files navigation

Flask Boilerplate for Profesional Development

Features

  • Integrated with Pipenv for package managing.
  • Fast deloyment to heroku with $ pipenv run deploy.
  • Use of .env file.
  • SQLAlchemy integration for database abstraction.

How to Start the Project?

  • main.py (it's where your endpoints should be coded)
  • models.py (your database tables and serialization logic)
  • utils.py (some reusable classes and functions)

Remember to migrate every time you change your models

You have to migrate and upgrade the migrations for every update you make to your models:

$ pipenv run migrate (to make the migrations)
$ pipenv run upgrade  (to update your databse with the migrations)

Manual Installation for Ubuntu & Mac

⚠️ Make sure you have python 3.7+ and MySQL installed on your computer and MySQL is running, then run the following commands:

$ pipenv install (to install pip packages)
$ pipenv run migrate (to create the database)
$ pipenv run start (to start the flask webserver)

Deploy to Heroku

This template is 100% compatible with Heroku[https://www.heroku.com/], just make sure to understand and execute the following steps:

// Install heroku
$ npm i heroku -g
// Login to heroku on the command line
$ heroku login -i
// Create an application (if you don't have it already)
$ heroku create <your_application_name>
// Commit and push to heroku (commited your changes)
$ git push heroku master

About

SQLAlqhemy+Flask_restx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published