Skip to content

Project template for API server using Flask and SQLAlchemy

License

Notifications You must be signed in to change notification settings

wisedier/flask-sqlalchemy-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-SQLAlchemy

This project was created to demonstrate how to set up and organize an API server project using:

Setup

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

Notes

The above listings are IMPORTANT for security if your service based on this project will be exposed to external connections.

About

Project template for API server using Flask and SQLAlchemy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published