Coder Social home page Coder Social logo

damianoalves / flask-api Goto Github PK

View Code? Open in Web Editor NEW
74.0 3.0 17.0 33 KB

:globe_with_meridians: A REST API template project developed with Python Flask

License: MIT License

Python 95.02% Mako 4.98%
python python-3 flask-application flask-sqlalchemy flask-restful heroku jwt-authentication rest-api

flask-api's Introduction

Flask API

This is a Flask API that I will keep improving with new features and functionalities. This boilerplate can be used as a template for bigger projects.

🔴 I'll start to improve this project again after a couple of years

Introduction

The “micro” in microframework means Flask aims to keep the core simple but extensible. Flask won’t make many decisions for you, such as what database to use.

By convention, templates and static files are stored in subdirectories within the application’s Python source tree, with the names templates and static respectively.

Dependencies

Virtual environments

$ sudo apt-get install python-virtualenv
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install Flask

Install all project dependencies using:

$ pip install -r requirements.txt

Running

$ export FLASK_APP=app.py
$ export FLASK_ENV=development
$ python -m flask run

This launches a very simple builtin server, which is good enough for testing but probably not what you want to use in production.

If you enable debug support the server will reload itself on code changes, and it will also provide you with a helpful debugger if things go wrong.

If you have the debugger disabled or trust the users on your network, you can make the server publicly available simply by adding --host=0.0.0.0 to the command line:

flask run --host=0.0.0.0

Running using Manager

This app can be started using Flask Manager. It provides some useful commands and configurations, also, it can be customized with more functionalities.

python manage.py runserver

Alembic Migrations

Use the following commands to create a new migration file and update the database with the last migrations version:

flask db revision --autogenerate -m "description here"
flask db upgrade head

This project also uses the customized manager command to perform migrations.

python manage.py db revision --autogenerate -m "description here"
python manage.py db upgrade head

To upgrade the database with the newest migrations version, use:

python manage.py db upgrade head

For more information, access Auto generating migrations.

Contributing

This API was developed based on:

Flask documentation

REST APIs with Flask and Python

The Ultimate Flask Course

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Certificate

Certificate

flask-api's People

Stargazers

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

Watchers

 avatar  avatar  avatar

flask-api's Issues

Do

So do ya

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.