GithubHelp home page GithubHelp logo

edhille / flask_api_example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apryor6/flask_api_example

0.0 1.0 0.0 293 KB

A demonstration of best practices for a large Flask API project

Python 100.00%

flask_api_example's Introduction

Example of a scalable Flask API

The site

A sample project showing how to build a scalable, maintainable, modular Flask API with a heavy emphasis on testing.

This is an example project using the structure proposed in this blog post.

Running the app

Preferably, first create a virtualenv and activate it, perhaps with the following command:

virtualenv -p python3 venv
source venv/bin/activate

Next, run

pip install -r requirements.txt

to get the dependencies.

Next, initialize the database

python manage.py seed_db

Type "Y" to accept the message (which is just there to prevent you accidentally deleting things -- it's just a local SQLite database)

Finally run the app with

python wsgi.py

Navigate to the posted URL in your terminal to be greeted with Swagger, where you can test out the API.

Running tests

To run the test suite, simply pip install it and run from the root directory like so

pip install pytest
pytest

flask_api_example's People

Contributors

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