Sample Project of building RESTFul API's using Python. PostgreSQL has been used as Database. Whole Code can be deployed in Heroku.
Code has the following things:
- Data Models
- Resources
- SQL Queries of Table Creation
- All Resources needed for Heroku Deployment.
- Requirements
EndPoints are of following Categories:
- Users
- Genre
- Artists
- Albums
- Tracks
- Media Types
- Playlist
It is postgreSQL Database, so local database can be set up, by using following link.
Once database is set up, you need to run queries from SQLQueries
folder.
Order of queries should be like this:
users.sql
user_session.sql
revoked_tokens.sql
artists.sql
album.sql
genre.sql
media_types.sql
tracks.sql
Once you are done with Database setup, now we have to deal with python setup,
pip install virtualenv
git clone https://github.com/taimoorpashanbs17/flask-jwt-postgres.git
cd flask-jwt-postgres
virtualenv myenv
myenv\Scripts\activate
source myenv/bin/activate`
pip install -r requirements.txt
- Don't upgrade or Downgrade the dependencies, use it, as they are mentioned.
- Enter Password on
config.ini
file atpassword
key. - If port is already use, then change the port with any four digit.
python3 app.py
Learn to use these end points, with following article
Also Postman collection is available within repo with FlaskDB.postman_collection.json
name.