Skip to main content
  • install using pip:

pip install django-site-navigation
  • add “site_navigation” to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'site_navigation'
)
  • add “site_navigation.context_processors.getNavigationProperties” to your TEMPLATE_CONTEXT_PROCESSORS:

TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'site_navigation.context_processors.getNavigationProperties'
)
  • add “site_navigation.middleware.RedirectMiddleware” to your MIDDLEWARE_CLASSES:

MIDDLEWARE_CLASSES = (
    ...
    'site_navigation.middleware.RedirectMiddleware'
)
  • add in urls.py:

from navigation.utils import addUrl
urlpatterns += addUrl('default_page.html')
  • create table:

python ./manage.py migrate
  • create templates: default_page.html

{% load site-navigation %}
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="description" content="{{ NAVIGATION_SUBDIVISION.description|default_if_none:'' }}">
    <meta name="keywords" content="{{ NAVIGATION_SUBDIVISION.keywords|default_if_none:'' }}">
    <title>
        <title>
            {% if NAVIGATION_SUBDIVISION.title %}{{ NAVIGATION_SUBDIVISION.title }}
            {% elif NAVIGATION_SUBDIVISION.pageTitle %} {{ NAVIGATION_SUBDIVISION.pageTitle }}
            {% elif NAVIGATION_SUBDIVISION.name %}{{ NAVIGATION_SUBDIVISION.name }}
            {% else %}{{ SITE_OPTIONS.title }}{% endif %}
        </title>
    </title>
</head>
<body>

{% breadcrumbs %}

<h1>
    {% if NAVIGATION_SUBDIVISION.pageTitle %}
        {{ NAVIGATION_SUBDIVISION.pageTitle }}
    {% else %}
        {{ NAVIGATION_SUBDIVISION.name }}
    {% endif %}
</h1>


{% block beforecontent %}
    {{ NAVIGATION_SUBDIVISION.before|default_if_none:''|safe }}
{% endblock %}

{% block content %}{% endblock %}

{% block aftercontent %}
    {{ NAVIGATION_SUBDIVISION.after|default_if_none:''|safe }}
{% endblock %}

</body>
</html>

menu.html

{% for sub in subdivisions|dictsortreversed:"priority" %}
    <li {% if sub == NAVIGATION_SUBDIVISION %} class="active" {% endif %}>
        <a href="{{ sub.getUrl }}" >
            {{ sub }}
        </a>
    </li>
{% endfor %}

breadcrumbs.html

<ul>
    <li><a href="/">Home</a></li>
    {% for s in NAVIGATION_BRANCH %}
        <li>{% if not forloop.last %}
                <a href="{{ s.getUrl }}">{{ s.name }}</a>
             {% else %}
                {{ s.name }}
             {% endif %}
        </li>
    {% endfor %}
</ul>

Metadata

Release files for django-site-navigation 0.0.2

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-site-navigation 0.0.2
File Size Uploaded Provenance
django-site-navigation-0.0.2.tar.gz 1.9 kB Without provenance Details

Release files / django-site-navigation-0.0.2.tar.gz

Download URL django-site-navigation-0.0.2.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
401d9c32eade0b41f9821dd09942e1e2ab86f617ec9caa207216b0c06df4ecf3
BLAKE2b-256 checksum
How to use checksums
ba3412ebd31b634af0e8ec05862e444cd1f9210a66bc61d32588ea68f5318c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-site-navigation 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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