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.dev0.tar.gz (89.3 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.dev0-py3-none-any.whl (112.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_fundamentals-0.2.1.dev0.tar.gz
  • Upload date:
  • Size: 89.3 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.dev0.tar.gz
Algorithm Hash digest
SHA256 56bed8a696da9c6265df55c217e1153fae4a949c4a283abd29b124eb94b0f032
MD5 4513ce26a32749bea76a6fe5e9c68d20
BLAKE2b-256 2263fbeef4f9bfd164a8a08a000b0804832e612153fdf9b7bd116bc85718bb56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_fundamentals-0.2.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce0ac41add2a5d8bd1b790fbd597b220b8ddbff201505c559528d730363dc9d6
MD5 6d5fac1ef25224802aa564464f6ae2aa
BLAKE2b-256 1bec62b4f8e00739e68bdf67eadfc92d2088e34deeb711c449e44acc082e09e0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1.dev0 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