This project is a Cinema Tickets Reservation API built using Django Rest Framework. It demonstrates various features and functionalities of Django Rest Framework, including different types of views (Function-Based Views, Class-Based Views, and ViewSets), and operations like GET, POST, PUT, and DELETE. The project also includes API documentation using Swagger and ReDoc.
- Models: Defines models for Movie, Guest, and Reservation.
- Serializers: Serializes the models for API responses.
- Views: Implements different types of views:
- Function-Based Views (FBV)
- Class-Based Views (CBV)
- ViewSets
- Operations: Supports various operations:
- GET: Retrieve data
- POST: Create new data
- PUT: Update existing data
- DELETE: Remove data
- Filtering and Searching: Implements filtering and searching for reservations by movie title.
- API Documentation: Provides API documentation using Swagger and ReDoc.
-
Guests:
GET /FBV/guests/
: List all guestsPOST /FBV/guests/
: Create a new guestGET /FBV/guest/<int:pk>/
: Retrieve a guest by IDPUT /FBV/guest/<int:pk>/
: Update a guest by IDDELETE /FBV/guest/<int:pk>/
: Delete a guest by ID
-
Movies:
GET /FBV/movies/
: List all moviesPOST /FBV/movies/
: Create a new movieGET /FBV/movie/<int:pk>/
: Retrieve a movie by IDPUT /FBV/movie/<int:pk>/
: Update a movie by IDDELETE /FBV/movie/<int:pk>/
: Delete a movie by ID
-
Reservations:
GET /FBV/reservations/
: List all reservationsPOST /FBV/reservations/
: Create a new reservationGET /FBV/reservation/<int:pk>/
: Retrieve a reservation by IDPUT /FBV/reservation/<int:pk>/
: Update a reservation by IDDELETE /FBV/reservation/<int:pk>/
: Delete a reservation by ID
- Guests:
GET /CBV/guests/
: List all guestsPOST /CBV/guests/
: Create a new guestGET /CBV/guest/<int:pk>/
: Retrieve a guest by IDPUT /CBV/guest/<int:pk>/
: Update a guest by IDDELETE /CBV/guest/<int:pk>/
: Delete a guest by ID
-
Guests:
GET /api/guests/
: List all guestsPOST /api/guests/
: Create a new guestGET /api/guests/<int:pk>/
: Retrieve a guest by IDPUT /api/guests/<int:pk>/
: Update a guest by IDDELETE /api/guests/<int:pk>/
: Delete a guest by ID
-
Movies:
GET /api/movies/
: List all moviesPOST /api/movies/
: Create a new movieGET /api/movies/<int:pk>/
: Retrieve a movie by IDPUT /api/movies/<int:pk>/
: Update a movie by IDDELETE /api/movies/<int:pk>/
: Delete a movie by ID
-
Reservations:
GET /api/reservations/
: List all reservationsPOST /api/reservations/
: Create a new reservationGET /api/reservations/<int:pk>/
: Retrieve a reservation by IDPUT /api/reservations/<int:pk>/
: Update a reservation by IDDELETE /api/reservations/<int:pk>/
: Delete a reservation by ID- Filtering and Searching:
GET /api/reservations/?movie__title=<title>
: Filter reservations by movie titleGET /api/reservations/?search=<title>
: Search reservations by movie title
- Clone the repository.
- Install the required dependencies.
- Run the Django development server.
- Access the API endpoints and documentation.
This project is licensed under the MIT License.