A compact library system built with Django.
- Browse and search Books and Authors
- Paginated list and detail views
- Full CRUD flows for books and authors
- Browse the catalog: Books and Authors
- Permissions-based access control
- Fine-grained roles via Django Groups
- Sign up, sign in, sign out
- Password reset and password change
- CSRF protection and secure sessions
- Django Admin tuned for quick data entry (filters, inlines, search)
- Python 3.12+, Django 4.2+, Django REST Framework
- Frontend: React + Vite (built output served via Django static files)
- ORM/DB: PostgreSQL (default) / SQLite (local fallback)
- Templates: Django Template Language (DTL)
- Auth: django.contrib.auth (users, groups, permissions)
- Styling: Bootstrap 5 + custom SCSS + motion library
Activate your Python 3.12+ environment
pip install -r requirements.txtpython manage.py migratepython manage.py createsuperusercd frontend
npm install
npm run build
cd ..python manage.py runserverthen open http://localhost:8000
This repository includes a Docker Compose configuration for running the Django Local Library app. It uses a persistent volume to store application data and separates migration from runtime for clean startup.
- Docker & Docker Compose v2+
- Optional: .env file to support environment variables (e.g. Django superuser credentials)
app
- Builds the Django app from the included Dockerfile (or uses the prebuilt image sgusic29/django-local-library).
- Runs python manage.py createsuperuser --noinput || true on startup (superuser creation is skipped if it already exists).
- Serves the Django development server on port 8000.
- Depends on the migrate service, ensuring database migrations are applied before startup.
- Data is stored in a named volume (django_data) mounted at /app/data.
migrate
- Service that runs Django migrations (python manage.py migrate) against the same image and volume.
- Ensures the database schema is ready before the app starts.
django_data
- Persistent named volume that keeps Django’s database and other data across container restarts.
The app reads environment variables from a .env file in the project root. These variables are mainly used for creating the initial Django superuser (e.g. username, email, password).
docker compose up -ddocker compose down