Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

django-fundamentals

A reusable base Django app used as a shared/common foundation for other Django apps. Install it into a project and get, out of the box:

  • A custom User model.
  • Authentication wired through django-allauth + dj-rest-auth — signup, login, logout, and password reset, both as server-rendered views under /accounts/ and as DRF endpoints under /api/auth/ (/api/auth/registration/, /api/auth/login/, /api/auth/password/reset/).
  • Object-level permissions via django-guardian, plus a 4-tier authorization model: Anonymous / Authenticated / Staff / Superuser.
  • DRF TokenAuthentication for API clients.
  • A server-rendered frontend baseline: Django templates as the source of truth, HTMX for server communication, Alpine.js for local UI state, and Tailwind CSS for styling.
  • A complete UI skeleton built from atomic-design components: app shell with sidebar and top navbar, a centered layout for auth pages, styled 404/403/400/500 pages, favicons, and dark mode. All colours and dimensions come from one design-token file. Every django-allauth page is themed. See docs/source/ui.md.

New projects are generated from django-fundamentals-cookiecutter, which pins this package as a dependency. Updates to this package (pip install -U django-fundamentals) propagate into every project built on top of.

Installation

Create and activate an isolated conda environment, then install with pip:

conda create -n django-fundamentals pip -c conda-forge
conda activate django-fundamentals
pip install django-fundamentals

Quickstart

In your Django project's settings.py (abbreviated — see docs/source/quickstart.md for the full, copy-pasteable version, including the ACCOUNT_*/LOGIN_REDIRECT_URL/REST_AUTH imports that must also be present or you'll silently fall back to Django/allauth's own defaults):

from django_fundamentals.settings import BASE_INSTALLED_APPS, BASE_MIDDLEWARE, BASE_AUTHENTICATION_BACKENDS, BASE_REST_FRAMEWORK

AUTH_USER_MODEL = "django_fundamentals.User"
INSTALLED_APPS = [*BASE_INSTALLED_APPS, ...]
MIDDLEWARE = [*BASE_MIDDLEWARE, ...]
AUTHENTICATION_BACKENDS = BASE_AUTHENTICATION_BACKENDS
REST_FRAMEWORK = BASE_REST_FRAMEWORK
SITE_ID = 1

In your project's urls.py:

from django.urls import include, path

urlpatterns = [
    path("", include("django_fundamentals.urls")),
    ...
]

See docs/source/quickstart.md for the full setup, including Tailwind/HTMX static-file wiring and the 4-tier permission helpers.

Development

conda create -n django-fundamentals pip -c conda-forge
conda activate django-fundamentals
pip install -e .[dev]
pytest

License

GNU General Public License v3 (or later). See LICENSE.

Metadata

Release files for django-fundamentals 0.2.1.dev6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-fundamentals 0.2.1.dev6
File Size Uploaded
django_fundamentals-0.2.1.dev6.tar.gz 89.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-fundamentals 0.2.1.dev6
File Interpreter ABI Platform
django_fundamentals-0.2.1.dev6-py3-none-any.whl Python 3 none any Details

Total release size: 201.8 kB

Release files / django_fundamentals-0.2.1.dev6.tar.gz

Download URL django_fundamentals-0.2.1.dev6.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4e3a545cc47096acdab3e2527750f9ecd8d3abec821403ffa10e22fda9767ae
BLAKE2b-256 checksum
How to use checksums
be1804c5703f566a3ad28b7b6c81ad0b386b09c47f3cd549c87e390753f582d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / django_fundamentals-0.2.1.dev6-py3-none-any.whl

Download URL django_fundamentals-0.2.1.dev6-py3-none-any.whl
Size 112.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e19b2c2ec6a7bba80b269c4c03c2878cfeff94fcd08fb8b1b9a51ee1dd61ec82
BLAKE2b-256 checksum
How to use checksums
2516993286795836acdda02a66fe141ce5554b5aafc305c474764528b4babdb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.2.1.dev6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page