This is a RESTful API for managing events, built with Django and Django REST Framework.
Given the 24-hour timeframe, I prioritized the core, foundational features of the API.
- Models: All 4 models (
UserProfile,Event,RSVP,Review) with correct relationships. - JWT Authentication: Secure user authentication using
djangorestframework-simplejwt. - Event API: Full CRUD operations for Events (
/api/events/). - Core Permissions:
- Only authenticated users can create events.
- Only the organizer of an event can edit or delete it (via
IsOrganizerOrReadOnlypermission).
- Public/Private Events: The main event list (
/api/events/) only shows public events or private events organized by the logged-in user. - Pagination: All list endpoints are paginated.
- Review API: Users can
POSTreviews andGETa list of reviews for a specific event. - RSVP API: Users can
POSTan RSVP for an event andPATCHtheir RSVP status.
- Clone the repository:
git clone https://github.com/your-username/event-management-system.git - Navigate to the directory:
cd event-management-system - Create and activate a virtual environment:
python -m venv venvsource venv/bin/activate - Install dependencies:
pip install -r requirements.txt - Run database migrations:
python manage.py migrate - Run the server:
python manage.py runserver
POST /api/token/(Get JWT token)POST /api/token/refresh/
POST /api/events/(Create Event)GET /api/events/(List public/my events)GET /api/events/{id}/(Get event details)PUT /api/events/{id}/(Update event - Organizer only)DELETE /api/events/{id}/(Delete event - Organizer only)
POST /api/events/{event_id}/reviews/(Add review)GET /api/events/{event_id}/reviews/(List reviews)
POST /api/events/{event_id}/rsvp/(RSVP to event)GET /api/events/{event_id}/rsvp/(List RSVPs for an event)PATCH /api/events/{event_id}/rsvp/{rsvp_id}/(Update RSVP status - Owner only)