A high-performance Quiz Engine with automated scoring, N+1 optimized queries, and hierarchical content management. π
- π Live API Documentation
- π¦ Technical Highlights
- π οΈ Built With
- π¬ API Endpoints
- βοΈ Setup & Installation
- π¬ Contact Information
The API is fully documented with drf-yasg. You can test the scoring logic and authentication directly through the interactive interface.
- Swagger UI: https://umit8102.pythonanywhere.com/swagger/
- ReDoc: https://umit8102.pythonanywhere.com/redoc/
Note: Use the "Authorize" button in Swagger with the format
Token <your_key>to access protected endpoints.
- N+1 Query Optimization: Database queries are optimized using Django's
annotateto ensure single-query efficiency for category and quiz listings, reducing database load significantly. - Dynamic Scoring Engine: Automated calculation of quiz results (correct/wrong count and percentage) upon submission, handled securely on the backend.
- Hierarchical Admin Panel: Integration of
django-nested-adminfor seamless management of complex Quiz -> Question -> Option relationships in a single view. - Environment-Aware Security: Protocol-safe Swagger configuration supporting both HTTP (Development) and HTTPS (Production/PythonAnywhere) with JWT/Token support.
- Core: Django 5.2 & Django REST Framework
- Database Optimization: Django ORM with
annotateandget_object_or_404for clean error handling. - Authentication: dj-rest-auth with Token system for secure API access.
- API Documentation: drf-yasg (Swagger/Redoc) with a custom Schema Generator for protocol handling.
| Method | Endpoint | Description |
|---|---|---|
| POST | /users/register/ |
New user registration |
| POST | /users/auth/login/ |
User login & Token retrieval |
| Method | Endpoint | Description |
|---|---|---|
| GET | /quiz/ |
List all Categories (N+1 Optimized) |
| GET | /quiz/quiz/ |
List all Quizzes with question counts |
| POST | /quiz/<id>/submit/ |
Submit quiz answers and receive automated score calculation |
git clone [https://github.com/umitarat-dev/quiz-platform-rest-api.git](https://github.com/umitarat-dev/quiz-platform-rest-api.git)
cd quiz-platform-rest-api
python -m venv env
source env/bin/activate # macOS/Linux
# env\Scripts\activate # WindowsCreate a .env file in the root directory:
SECRET_KEY=your_secret_key_here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
ENV_NAME=devCreate a .env file in the root directory:
pip install -r requirements.txt
python manage.py migrate
python manage.py runserverI am always open to discussing new projects, creative ideas, or opportunities to be part of your visions.
- LinkedIn: linkedin.com/in/umit-arat
- Email: umitarat8098@gmail.com
- GitHub: github.com/umitarat-dev (Current Workspace)