/flask-jwt-postgres

Sample Flask JWT Extended Project for creating API End Point's

Primary LanguagePython

Flask RestAPI PostgreSQL

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:

  1. Data Models
  2. Resources
  3. SQL Queries of Table Creation
  4. All Resources needed for Heroku Deployment.
  5. Requirements

EndPoints are of following Categories:

  1. Users
  2. Genre
  3. Artists
  4. Albums
  5. Tracks
  6. Media Types
  7. Playlist

Instructions:

Create and Run Database:

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:

  1. users.sql
  2. user_session.sql
  3. revoked_tokens.sql
  4. artists.sql
  5. album.sql
  6. genre.sql
  7. media_types.sql
  8. tracks.sql

Install Python Virtual Environment:

Once you are done with Database setup, now we have to deal with python setup,

Install Virtual Environment

pip install virtualenv

Clone the Project

git clone https://github.com/taimoorpashanbs17/flask-jwt-postgres.git

Navigate to Your Project

cd flask-jwt-postgres

Create Virtual Environment within project

virtualenv myenv

For Windows

myenv\Scripts\activate

For Mac and Linux

source myenv/bin/activate`

Install dependencies

pip install -r requirements.txt

Note:

  1. Don't upgrade or Downgrade the dependencies, use it, as they are mentioned.
  2. Enter Password on config.ini file at password key.
  3. If port is already use, then change the port with any four digit.

Start using this Project.

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.

🔗 Get In Touch with me

linkedin