This project was created to demonstrate how to set up and organize an API server project using:
At first, you have to install a database server. In this project, I used PostgreSQL. If you want to change it from PostgreSQL to other one,
remove a line contains psycopg2-binary
from requirements.txt and update SQLALCHEMY_DATABASE_URL.
createuser -h 127.0.0.1 -d -P api
createdb -O api api
psql -h 127.0.0.1 -U api -W
After setup database, install required Python packages and run the server. Server will listening at 127.0.0.1:5000
pip install -r requirements.txt
python manage.py initdb
python manage.py run
You can check Swagger UI for API documentation at http://127.0.0.1:5000/docs
- Update SECRET value
- Add secret.py to .gitignore
- In order to use uWSGI, you can use wsgi.py as a callable app module
The above listings are IMPORTANT for security if your service based on this project will be exposed to external connections.