A beautiful, professional, responsive multiple-choice quiz (MCQ) app built with Django 5 and Bootstrap 5. Supports single/multi-select questions, instant scoring, and detailed results with a modern UI and light/dark theme toggle.
- Single and multiple-answer questions
- Instant scoring with per-question correctness breakdown
- Modern responsive UI (Bootstrap 5 + custom CSS)
- Light/Dark theme toggle with local storage
- Admin interface for managing quizzes/questions/choices
- Sample data seeding command
- Create/activate virtual environment:
cd "C:\Users\Rohit Kumar\Desktop\Mcq-Form Django"
python -m venv .venv
.venv\Scripts\Activate.ps1If activation is blocked:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force
.venv\Scripts\Activate.ps1- Install dependencies:
python -m pip install --upgrade pip
python -m pip install django==5.0.6- Apply migrations and seed sample quiz:
python manage.py migrate
python manage.py seed_quiz- Run the development server:
python manage.py runserverOpen http://localhost:8000 in your browser.
Create a superuser to manage quizzes:
python manage.py createsuperuserThen visit http://localhost:8000/admin
Mcq-Form Django/
├─ mcqsite/ # Project settings/urls
├─ quiz/ # App with models, views, admin, urls
│ ├─ management/commands/ # seed_quiz command
│ └─ migrations/
├─ templates/
│ └─ quiz/
│ ├─ home.html
│ ├─ quiz_detail.html
│ └─ result.html
├─ static/
│ ├─ css/quiz.css
│ └─ js/theme.js
├─ manage.py
└─ README.md
- Add/edit quizzes in the admin or via the
seed_quizcommand - Theming: tweak
static/css/quiz.cssandstatic/js/theme.js - Templates:
templates/quiz/*.html - Models:
quiz/models.py(supports question order and single/multi types)
- Template logic: prefer Django filters/tags like
yesnoand{% if %} - Port in use:
python manage.py runserver 8001 - Static not loading in dev: ensure
DEBUG=TrueandSTATIC_URLconfigured
- Set
DEBUG=False, configureALLOWED_HOSTS - Serve static via
collectstaticand a proper web server (e.g., Nginx) - Use a production DB (e.g., Postgres) and WSGI/ASGI server (gunicorn/uvicorn)
MIT