Go to file
2021-10-28 09:50:04 +00:00
app Update to use flask-restx 2020-01-22 11:05:43 -06:00
commands Convert to black formatting 2019-08-03 12:55:38 -04:00
docs Add image of app to README 2019-08-26 08:34:13 -04:00
.gitignore Add skeleton app with namespaces 2019-05-18 13:00:13 -04:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2021-10-28 09:50:04 +00:00
manage.py Convert to black formatting 2019-08-03 12:55:38 -04:00
README.md Update README 2019-08-26 08:35:09 -04:00
requirements.txt Update to use flask-restx 2020-01-22 11:05:43 -06:00
wsgi.py Convert to black formatting 2019-08-03 12:55:38 -04:00

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