Skip to content

A boiler plate for Restful API development in FLASK (With Application Context , SqlAlchemy and Flask restfull)

License

Notifications You must be signed in to change notification settings

jaywonder20/Flask_Api_Starter

Repository files navigation

Flask-APi Starter

Build Status

Flask-APi Starter Template With Application Context and SqlAlchemy

  • Flask Application Context
  • Flask Restfull2 for api endpoints
  • Flask SqlAlchemy
This WireFrame uses a number of open source projects to work properly:
  • Flask - A Micro Web Framework
  • Flask restful - Flask extension for building REST APIs
  • Flask restful Swagger 2 - A Swagger spec extractor for flask-restful
  • Flask CORS - A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible
  • Python Dotenv - For managing app settings during development and in production
  • Flask-SQLAlchemy - an extension for Flask that adds support for SQLAlchemy

Installation

This app requires python 3.x.x to run.

It is always recommended to use a virtual environment while developing Python applications

Installing Virtual env on Linux.
$ sudo apt-get install python3-pip
$ sudo pip3 install virtualenv
Then create the virtualEnv using
$ virtualenv venv 
$ source venv/bin/activate

Configuration of environments Variables and application

  • Edit the .env file to set environments variables like the database URI and other necessary environment variables (This file is loaded by python-dotenv when the app starts and the environment variables declared in the .env file are available for use in the app)

  • Edit the .flaskenv for the flask app configuration (The .flaskenv file is automatically imported by the flask command)

Then install install Requirements
$ pip install -r requirements.txt 
$ flask run

Navigate to your server address in your preferred browser.

127.0.0.1:5000

App

Other endpoints and customizations can then be added, THIS IS JUST A BASIC BOILERPLATE
Database migrations can also be made
$ flask db init
$ flask db migrate
$ flask db upgrade

Development

Want to contribute? Great!

Feel free to reachout

Todos

  • Implementation of marshmallow (for object serialization/deserialization)
  • Addition of JWT

License

MIT

Free Software, Hell Yeah!

About

A boiler plate for Restful API development in FLASK (With Application Context , SqlAlchemy and Flask restfull)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages