/project-django-smpl-api

A Simple API Using Django and OMDB API

Primary LanguagePython

Getting Started

First, setup virtual environment and activate

# Create
python3 -m venv venv

# Activate
source venv/bin/activate

Then, install packages from requirements.txt

pip install -r requirements.txt

Now, let's to connect to your Database following next steps:

  1. Set your credencias into the .env file, look .env_example as guide.
  2. Execute python manage.py migrate

Finally, let's to rise our server executing python manage.py runserver and type in your browser http://localhost:8000/

Alternative Admin Section

We have an admin section that we can use. Just execute the following:

  1. command python manage.py createsuperuser and type your credentials.
  2. enter throught this url http://localhost:8000/admin and type your credentials that you joined in the previous step.

Try Out the API

You can access to http://localhost:8000/api/v1/ and check what endpoints exists and make CRUD operations.

DEMO

In this demo we use Postman, we have the following request: Screenshot 2024-06-27 at 2 08 52 AM and we have the following response: Screenshot 2024-06-27 at 2 09 34 AM

Checking Database

If we chake our database, the api_movie and api_rating filled with the previous data.

api_movie table

Screenshot 2024-06-27 at 2 13 17 AM

api_rating table

Screenshot 2024-06-27 at 2 14 21 AM