Skip to main content

Collaborative staff wiki for Django Admin — edit in the browser, search with Postgres.

Project description

django-admin-wiki

Collaborative staff wiki for Django Admin — edit in the browser, search with Postgres.

A reusable Django app for internal / back-office documentation next to django.contrib.admin. Not a public MediaWiki clone.

Features

  • In-browser WYSIWYG editing (Summernote by default; switchable to textarea or a custom widget)
  • Up to three-level navigation tree
  • Full-text search (PostgreSQL FTS) with SQLite/MySQL substring fallback
  • Revision history on every staff save
  • Import from Markdown / MkDocs (import_mkdocs)
  • Visible link from Django admin (Wiki pages changelist)
  • Premium cloud mode: Hosted on our servers via API (no local wiki tables)

Requirements

  • Python ≥ 3.10
  • Django ≥ 4.2, < 6
  • PostgreSQL recommended for production search (django.contrib.postgres) when STORAGE="local"

Install (5 minutes) — self-hosted (OSS)

pip install django-admin-wiki
# settings.py
INSTALLED_APPS = [
    ...,
    "django.contrib.postgres",  # if using Postgres FTS
    "django_summernote",        # required for default WYSIWYG editor
    "django_admin_wiki",
]

MEDIA_URL = "/media/"
MEDIA_ROOT = BASE_DIR / "media"

DJANGO_ADMIN_WIKI = {
    "STORAGE": "local",
    "SEARCH_BACKEND": "postgres",  # or "fallback"
    "SEARCH_CONFIG": "french",
    "EDITOR": "summernote",
    "ALLOW_MARKDOWN_READ": True,
    "DOCS_DIR": BASE_DIR / "wiki_docs",
    "MKDOCS_YML": BASE_DIR / "wiki_docs" / "mkdocs.yml",
    "URL_PREFIX": "wiki/",
    # Media: default local FS under DOCS_DIR/uploads via POST /wiki/media/upload/
    # "MEDIA_BACKEND": "django",  # use Django STORAGES (S3) instead
    # "MEDIA_MAX_UPLOAD_BYTES": 5 * 1024 * 1024,
}

Images in the editor are uploaded as files (no base64 in the database). Optional S3 for self-hosted:

pip install "django-admin-wiki[s3]"
# settings — host-owned bucket
INSTALLED_APPS += ["storages"]
STORAGES = {
    "default": {
        "BACKEND": "storages.backends.s3.S3Storage",
        "OPTIONS": { ... },
    },
    "staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"},
}
DJANGO_ADMIN_WIKI = {..., "MEDIA_BACKEND": "django"}
# urls.py
path("summernote/", include("django_summernote.urls")),
path("wiki/", include("django_admin_wiki.urls")),
python manage.py migrate
python manage.py setup_wiki_groups   # creates "Wiki readers" + "Wiki editors"
python manage.py runserver

Then assign users to a group in Django Admin → Users (or Groups). is_staff alone does not grant wiki access.

Premium — cloud storage (no local wiki tables)

Subscribe at django-admin-wiki.enprod.fr. You receive write and read-only API keys from the account dashboard.

INSTALLED_APPS = [..., "django_summernote", "django_admin_wiki"]

# Prevent host migrate from creating wiki tables:
MIGRATION_MODULES = {"django_admin_wiki": None}

DJANGO_ADMIN_WIKI = {
    "STORAGE": "cloud",
    "CLOUD_API_URL": "https://django-admin-wiki.enprod.fr",
    "CLOUD_API_KEY": "daw_live_...",        # write key (editors)
    "CLOUD_API_KEY_READ": "daw_live_...",   # read-only key (readers)
    "EDITOR": "summernote",
}
path("summernote/", include("django_summernote.urls")),
path("wiki/", include("django_admin_wiki.urls")),
# Do NOT run migrations for django_admin_wiki

Isolation: every API request is scoped by the tenant bound to your API key. Tenant A cannot read Tenant B data.

Read vs write (client Django users)

URL Who can enter
/admin/ Django Admin → needs is_staff (always)
/wiki/ membership in Wiki readers or Wiki editors (not is_staff)

Rights follow the logged-in user of your Django project (session cookie). Cloud SaaS accounts (email/password on the Premium site) only manage billing / API keys.

After migrate (or python manage.py setup_wiki_groups), two groups exist:

Group Can
Wiki readers open /wiki/, search, view pages
Wiki editors readers + create / edit / upload media

Assign users in Django Admin → Users. Superusers always have full wiki access.

Premium cloud mode — dual API keys

The host app holds two keys; the package picks one from request.user:

User group Key used
Wiki editors (wiki_can_write) CLOUD_API_KEY
Wiki readers CLOUD_API_KEY_READ

Create both keys from the account dashboard. The cloud API rejects writes on a read-only key.

See docs/PREMIUM.md.

Change the editor

DJANGO_ADMIN_WIKI = {"EDITOR": "textarea"}  # or "custom" + EDITOR_WIDGET

Import existing MkDocs docs (local mode)

python manage.py import_mkdocs
python manage.py refresh_wiki_search_vectors  # Postgres

Settings reference

Key Default Description
STORAGE "local" "local" (host DB) or "cloud" (Premium API)
CLOUD_API_URL "" Base URL of the cloud API
CLOUD_API_KEY "" Bearer write key daw_live_…
CLOUD_API_KEY_READ "" Bearer read-only key (readers in cloud mode)
SEARCH_BACKEND "postgres" local mode only
SEARCH_CONFIG "french" local Postgres FTS config
EDITOR "summernote" summernote, textarea, or custom
EDITOR_WIDGET None Dotted path when EDITOR="custom"
ALLOW_MARKDOWN_READ True Convert legacy Markdown on read
DOCS_DIR / MKDOCS_YML wiki_docs MkDocs import (local)
HOME_SLUG "index" Home page slug
URL_PREFIX "wiki/" Link rewrite prefix for import
MAX_NAV_DEPTH 3 Max menu depth (root → …)

Breaking choices (v1)

  • Postgres recommended for local FTS; SQLite uses fallback search
  • Summernote is the default editor
  • Navigation is up to three levels (root → section → page)
  • Cloud mode uses shared DB with tenant_id isolation (not DB-per-customer)

Example project

From the repository root:

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
cd example_project
python manage.py migrate
python manage.py setup_wiki_groups
python manage.py import_mkdocs
python manage.py createsuperuser
python manage.py runserver

See example_project/README.md.

License

BSD-3-Clause (OSS / local mode). Premium cloud hosting is a commercial subscription.

Project details


Download files

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

Source Distribution

django_admin_wiki-0.1.0.tar.gz (31.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_admin_wiki-0.1.0-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_wiki-0.1.0.tar.gz.

File metadata

  • Download URL: django_admin_wiki-0.1.0.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for django_admin_wiki-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32dcadc99da302ff0b738da61365762b20c6fe99527d0c0bb1351b9b108451aa
MD5 0bfdaa65bfc940607b15393a8d2909f4
BLAKE2b-256 d477fb69303783de879deeb9d0e843751119b978ff8dba53d9302eb08ab353e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_admin_wiki-0.1.0.tar.gz:

Publisher: publish.yml on csurbier/the-django-admin-wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_admin_wiki-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_wiki-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 638563f8d06cd8ed8db632ae8c63cccc8b825d268c0857638daf8cff40667fc5
MD5 1e8cb5ff1991044175d5451202ceb940
BLAKE2b-256 f06704cab36f7acc7227e39898cba1564062f0437acdba5b1bab0ed1ce3434f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_admin_wiki-0.1.0-py3-none-any.whl:

Publisher: publish.yml on csurbier/the-django-admin-wiki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page