Skip to content

zoma00/django-users-vehicle-forms-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Users & Vehicles Forms API

CI Python Django DRF License

A Django 5 application for managing clients, vehicles, and vehicle services. It combines a server-rendered forms UI (Django forms + Bootstrap templates) with an authenticated REST API built on Django REST Framework.

Features

  • Client management — registration forms with address and international phone number validation (django-phonenumber-field)
  • Vehicle tracking — vehicle types, VIN generation, and client–vehicle relationships
  • Service records — services linked to vehicles by VIN, with a combined vehicle/service listing view
  • REST API — DRF DefaultRouter viewsets protected by Basic or session authentication and IsAuthenticated
  • Custom accounts app — user registration, custom authentication backend, and token utilities
  • Custom middleware — authentication middleware and structured request logging (loguru + structlog)
  • Test data toolingpopulate.py and data_generator.py seed realistic data using Faker and faker-vehicle

Application Flow

Application flow from the web UI and API clients through Django middleware, server-rendered views or DRF viewsets, the Django ORM, and the SQLite development database

API Endpoints

Endpoint Description
GET/POST /api/clients/ List and create clients
GET/POST /api/vehicle/ List and create vehicles
GET/POST /api/vehicle_types/ List and create vehicle types
/admin/ Django admin

Standard DRF detail routes (/api/clients/<id>/, etc.) support retrieve, update, and delete.

Web UI Routes

Route Page
/index/ Dashboard
/login / /logout/ Authentication
/clients/ Client list
/clients/register Client registration form
/user_register/ User sign-up
/service/ Vehicles with service records

Tech Stack

  • Python 3 / Django 5.0 / Django REST Framework 3.15
  • SQLite for development, PostgreSQL-ready (psycopg2)
  • Gunicorn + Procfile for Heroku-style deployment
  • Pipenv (Pipfile) or pip (requirements.txt) dependency management

Getting Started

git clone git@github.com:zoma00/django-users-vehicle-forms-api.git
cd django-users-vehicle-forms-api

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

Then open http://127.0.0.1:8000/index/ for the web UI or http://127.0.0.1:8000/api/ for the browsable API.

To seed demo data:

python populate.py

Project Structure

first_pro/     Project settings, root URLs, WSGI/ASGI entry points
first_app/     Clients, vehicles, and services: models, forms, views, middleware
api/           DRF serializers, viewsets, and router
accounts/      User registration, auth backend, token utilities
templates/     Bootstrap-based HTML templates

License

MIT — see LICENSE.

About

Django 5 and DRF application for clients, vehicles, and service records with token-authenticated APIs, custom middleware, logging, and tests.

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors