Django Directory CMS
A reusable Django CMS package providing SEO-optimized pages and hierarchical menus with Bootstrap Icons support.
Features
-
Pages App: Highly SEO-optimized static pages with:
- 16 SEO fields (title, meta description, OG tags, Twitter cards, schema.org)
- Automatic slug generation with collision handling
- Integration with
django-seo-auditfor SEO scoring - Publishing controls (active, published status)
-
Menus App: Hierarchical navigation menus with:
- Parent/child relationships for dropdown menus
- Bootstrap Icons integration (42 curated icons)
- Page linking with automatic URL updates
- Custom URL support for external links
- Order control and visibility settings
- Global context processor for site-wide access
Installation
pip install django-directory-cms
Quick Start
1. Add to INSTALLED_APPS
# settings.py
INSTALLED_APPS = [
# ...
"django_directory_cms.pages",
"django_directory_cms.menus",
# Required dependency
"django_seo_audit",
]
2. Add Context Processor
# settings.py
TEMPLATES = [
{
"OPTIONS": {
"context_processors": [
# ...
"django_directory_cms.menus.context_processors.menu_items",
],
},
},
]
3. Run Migrations
python manage.py migrate django_directory_cms_pages
python manage.py migrate django_directory_cms_menus
4. Include URLs
# urls.py
from django.urls import include, path
urlpatterns = [
# ...
path("pages/", include("django_directory_cms.pages.urls")),
]
Usage
Creating Pages
Pages can be created via Django admin or programmatically:
from django_directory_cms.pages.models import Page
page = Page.objects.create(
title="About Us",
content="<p>Welcome to our site!</p>",
seo_title="About Our Company",
meta_description="Learn more about our mission and values",
is_published=True,
)
# Access SEO methods from django-seo-audit mixin
print(page.get_seo_title()) # "About Our Company"
print(page.get_absolute_url()) # "/pages/about-us/"
Creating Menus
Menu items can link to pages or custom URLs:
from django_directory_cms.menus.models import MenuItem
# Link to a page
menu_item = MenuItem.objects.create(
title="About",
anchor_text="About",
page=page,
icon_class="bi-info-circle",
order=1,
)
# Custom external link
external_link = MenuItem.objects.create(
title="Documentation",
anchor_text="Docs",
url="https://docs.example.com",
icon_class="bi-book",
is_external=True,
order=2,
)
# Hierarchical menu
parent = MenuItem.objects.create(
title="Resources",
anchor_text="Resources",
url="/resources/",
order=3,
)
child = MenuItem.objects.create(
title="Blog",
anchor_text="Blog",
url="/blog/",
parent=parent,
order=1,
)
Templates
Access menus in templates via context processor:
<!-- Menu items are available globally as `menu_items` -->
<nav>
<ul>
{% for item in menu_items %}
<li>
<a href="{{ item.get_url }}" {% if item.is_external %}target="_blank"{% endif %}>
{% if item.display_icon %}<i class="{{ item.display_icon }}"></i>{% endif %}
{{ item.anchor_text }}
</a>
{% if item.menu_children %}
<ul>
{% for child in item.menu_children %}
<li><a href="{{ child.get_url }}">{{ child.anchor_text }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
Requirements
- Python 3.12+
- Django 4.2+
- django-seo-audit 0.2.0+
- Pillow 10.0.0+ (for image fields)
License
MIT License - see LICENSE file for details.
Credits
Built by the Directory Platform team.
Links
- GitHub: https://github.com/directory-platform/django-directory-cms
- PyPI: https://pypi.org/project/django-directory-cms/
- Issues: https://github.com/directory-platform/django-directory-cms/issues
Development
See CLAUDE.md for development guidelines and architecture documentation.
Metadata
Release files for django-directory-cms 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_directory_cms-0.2.0.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_directory_cms-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.8 kB
Release files / django_directory_cms-0.2.0.tar.gz
| Download URL | django_directory_cms-0.2.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc98476b4eb9f9b50850b01614d4859e094c614d6aa615173ea9096c14c303bc
|
|
BLAKE2b-256 checksum How to use checksums |
72b2e4618d1e32b00f0c7e30080c12ff3a5eab344551e6444e73d72c1acf0e74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2025.
Transparency logRelease files / django_directory_cms-0.2.0-py3-none-any.whl
| Download URL | django_directory_cms-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03155ea411848198249ba4b2aa2ca9fa6c25ae5f3a3b2e1724bef44703e1cfbb
|
|
BLAKE2b-256 checksum How to use checksums |
b33bdf359c1f7b7fc15fb25ea4f97ae7ce1ca204e5a14c012102cce4cd44ec69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2025.
Transparency log