A Django parking ticket system with regional filtering and ForeignKey relationships.
Tickets are submitted with a region dropdown populated from the database. The day of the week is automatically derived from the ticket's timestamp and stored on save. The history page lets users filter tickets by region and day. A ForeignKey links each Ticket to a Region, and both views are implemented as class-based views that read directly from request.POST. Region data must be seeded manually via the Django admin before use.
- Python 3.10+
- Django 5.0
regional-parking-system/
├── manage.py
├── pyproject.toml
├── poetry.lock
├── .gitignore
├── README.md
├── templates/
│ ├── home.html # Submission form with region dropdown
│ └── history.html # Filterable ticket history
└── django_project/
├── __init__.py
├── asgi.py
├── models.py # Region and Ticket models
├── settings.py
├── urls.py
├── views.py # HomeView and HistoryView CBVs
├── wsgi.py
├── static/
│ └── style.css
└── migrations/
├── __init__.py
└── 0001_initial.py
poetry install
python manage.py migrate
python manage.py createsuperuser
python manage.py runserverSeed regions via the admin at http://127.0.0.1:8000/admin/ before submitting tickets. Then open http://127.0.0.1:8000.
| File | What it does |
|---|---|
manage.py |
Django project entry point |
django_project/models.py |
Region model and Ticket model with ForeignKey to Region |
django_project/views.py |
HomeView (submit) and HistoryView (filter) — raw POST handling |
django_project/urls.py |
Routes / and /history/ |
templates/home.html |
Form with region dropdown |
templates/history.html |
History page with region + day filter |
Biswajeet Sahoo
MIT License