Skip to content

This project is inspired by IMDB i have tried to create rest api just like IMDB, with features like Create Movie, Create Review, Give rating, and can be edited by the person who has create the movie and admin can add stream platform

Notifications You must be signed in to change notification settings

yashpatel-py/restAPI-imdb-clone-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watch Mate

Hosted on heroku

I ma creating this project and learning the django rest framework

Youtube Django Django RestFramework Python VS Code

Steps to run this project

  • Clone the project
  • Create a virtual environment using python3 -m venv env
  • Actiivate the virtual environment using source env/bin/activate
  • Install the requirements using pip install -r requirements.txt
  • Run the command python manage.py makemigrations to create the migrations
  • Then run the command python manage.py migrate to apply the migrations
  • Now are ready to run the server using python manage.py runserver

Login, Logout and Register

Login (All Users)

Request: POST

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Path: http://127.0.0.1:8000/account/login/

Login example

Register (All Users)

Request: POST

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

When you register your account at that time your token will be generated automatically and you will be not be registred as admin if you login from this endpoint so if you want to be admin user then you need to run command as python manage.py createsuperuser and then login from the login endpoint then you will get token related to admin user and you can access all endpoints which are made for normal users and admin users.

Path: http://127.0.0.1:8000/account/register/

register example

Logout (All Users)

Request: POST

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

When you logout the user your token will be deleted and you will not be able to access any endpoints which are made for normal users and admin users. To access them again you need to login

Path: http://127.0.0.1:8000/account/logout/

logout account

Normal User Related Endpoints

Movie List (For All users is you send GET request)

Request: POST(if admin user) & GET(if normal user or not logged in)

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

In this endpoint you can see all the list even if you are not admin or not logged in.

Path: http://127.0.0.1:8000/watch/list/

movie list

Create Review (User who are logged in)

Request: POST(if you are normal user or admin)

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Now here <int:pk> this means that you need to write the movie id which you want to review.

Path: http://127.0.0.1:8000/watch/<int:pk>/review-create/

Login example

Review List (User who are logged in)

Request: GET(If User is logged in)

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Now here <int:pk> this means that you need to write the movie id which you want to see all the reviews related to that movie only.

Path: http://127.0.0.1:8000/watch/<int:pk>/reviews/

Review List

Review Detail (User who are logged in)

Request: GET, PUT, DELETE

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Now here <int:pk> this means that you need to write the review id which you want to see or update or delete that review.

Path: http://127.0.0.1:8000/watch/review/<int:pk>/

Review Detail

Movie Detail (Admin can delete and update)

Request: GET, PUT, DELETE

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Now here <int:pk> this means that you need to write the movie id which you want to see or update or delete that review.

Path: http://127.0.0.1:8000/watch/<int:pk>

Movie Detail

Admin Related Endpoints

Create Stream Platform (For Admin users)

Request: POST(if admin user) & GET(if normal user)

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Use the token that was created when you logged in and you must be ADMIN to create a Stream platform

Path: http://127.0.0.1:8000/watch/stream/

Create Stream Platform

Create Movie (For Admin users)

Request: POST(if admin user) & GET(if normal user)

Use this endpoint in any client software like postman or Thunder client(in vscode) to generate a Token

Use the token that was created when you logged in and you must be ADMIN to create a Stream platform

Path: http://127.0.0.1:8000/watch/list/

Create Movie

About

This project is inspired by IMDB i have tried to create rest api just like IMDB, with features like Create Movie, Create Review, Give rating, and can be edited by the person who has create the movie and admin can add stream platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published