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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_fundamentals-0.2.1.dev6.tar.gz (89.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_fundamentals-0.2.1.dev6-py3-none-any.whl (112.7 kB view details)

Uploaded Python 3

File details

Details for the file django_fundamentals-0.2.1.dev6.tar.gz.

File metadata

  • Download URL: django_fundamentals-0.2.1.dev6.tar.gz
  • Upload date:
  • Size: 89.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for django_fundamentals-0.2.1.dev6.tar.gz
Algorithm Hash digest
SHA256 a4e3a545cc47096acdab3e2527750f9ecd8d3abec821403ffa10e22fda9767ae
MD5 f0026ba46155b74f40e633dd29e7da5c
BLAKE2b-256 be1804c5703f566a3ad28b7b6c81ad0b386b09c47f3cd549c87e390753f582d2

See more details on using hashes here.

File details

Details for the file django_fundamentals-0.2.1.dev6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_fundamentals-0.2.1.dev6-py3-none-any.whl
Algorithm Hash digest
SHA256 e19b2c2ec6a7bba80b269c4c03c2878cfeff94fcd08fb8b1b9a51ee1dd61ec82
MD5 3708c552708960a41b55dc127d30852e
BLAKE2b-256 2516993286795836acdda02a66fe141ce5554b5aafc305c474764528b4babdb2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1.dev6 This release

2 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