A clean, versioned, production-style Event Management API built with Django REST Framework.
This project demonstrates authentication, permissions, CRUD operations, custom user access rules, and a professional API structure.
- Token Authentication
- Register API
- Login API
- Secure password hashing
- Unique username & email
- Token generation on login
- Create, Read, Update, Delete (CRUD)
- Each event is owned by the user who created it
- Automatic owner assignment
- Timestamp tracking (
created_at,updated_at)
- Public access for GET requests
- Authenticated access for create/update/delete
- Custom permission: Only owner can modify or delete their events (
IsOwner)
- Python 3.12.3
- Django 5.2
- Django REST Framework
- DRF Token Authentication
core/
β
βββ manage.py
β
βββ core/ # Project settings
β βββ __init__.py
β βββ asgi.py
β βββ settings.py
β βββ urls.py
β βββ wsgi.py
β
βββ events/ # App containing Event model
β βββ __init__.py
β βββ admin.py
β βββ apps.py
β βββ migrations/
β β βββ 0001_initial.py
β βββ models.py
β βββ tests.py
β βββ views.py (empty/not used)
β
βββ api/
βββ v1/
βββ events/
βββ __init__.py
βββ serializers.py
βββ views.py
βββ urls.py
βββ permissions.py| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/events/register/ | Register new user |
| POST | /api/v1/events/login/ | Login & get token |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /api/v1/events/ | β | List all events |
| POST | /api/v1/events/ | βοΈ | Create event (owner auto) |
| GET | /api/v1/events// | β | Retrieve event |
| PUT | /api/v1/events// | βοΈ | Update event (owner only) |
| PATCH | /api/v1/events// | βοΈ | Partial update |
| DELETE | /api/v1/events// | βοΈ | Delete (owner only) |
git clone <your-repo-url>
pip install -r requirements.txt
cd src/core
python manage.py makemigrations
python manage.py migrate
python manage.py runserver