This API service is designed for cinema management and is written in Django Rest Framework. It provides endpoints for managing orders and tickets, creating movies with genres and actors, creating cinema halls, adding movie sessions, and filtering movies and movie sessions.
To install the Cinema API, you need to follow the below steps:
- Install PostgresSQL and create a database
- Clone the repository using
git clone https://github.com/MrYuriy/DRF-Cinema-API.git
- Navigate to the repository directory using
cd DRF-Cinema-API
- Create a virtual environment using
python -m venv venv
- Activate the virtual environment on Linux/macOS using
source venv/bin/activate
or on Windows usingvenv\Scripts\activate
- Install the required dependencies using
pip install -r requirements.txt
- Set environment variables like in .env_sample. Create .env file in your project's directory:
echo. >.env
- Apply migrations to the database using
python manage.py migrate
- Start the server using
python manage.py runserver
To run the Cinema API with Docker, you need to follow the below steps:
- Ensure that Docker is installed on your system
- Clone the repository using
git clone https://github.com/MrYuriy/DRF-Cinema-API.git
- Add the .env file to the root of the project. In this file you must specify the values of the environment variables. Use the example which is in the .env.sample file.
- Navigate to the repository directory using
cd DRF-Cinema-API
- Build the Docker image using
docker-compose build
- Start the Docker container using
docker-compose up
To get access to the Cinema API, you need to create a user by sending a POST request to /api/user/register/
and passing the required parameters. After creating the user, you can get an access token by sending a POST request to /api/user/token/
and passing the user's credentials.
The Cinema API offers the following features:
- JWT authentication
- Admin panel at
/admin/
- Swagger documentation at
/api/doc/swagger/
- Managing orders and tickets
- Creating movies with genres and actors
- Creating cinema halls
- Adding movie sessions
- Filtering movies and movie sessions