Package: django-lineup
Multiple navigation system for django sites.Django Lineup lets you manage a tree of items. Each first level node represents a menu you can include in your templates.DocumentationThe full documentation is athttps://django-lineup.readthedocs.io.QuickstartInstall Django Lineup:pip install django-lineupAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'lineup.apps.LineupConfig',...)Make sure therequestscontext processor is included (it is by default):TEMPLATES=[{'OPTIONS':{'context_processors':["django.template.context_processors.request",],},},]Render a menu::{% load lineup_tags %}
{% lineup_menu 'my-root-item-slug '%}Render the breadcrumbs::{% load lineup_tags %}
{% lineup_breadcrumbs 'my-root-item-slug '%}Import a menu from a json::$ python manage.py import_menu_from_jsonJson example::{
  "label": "Main Menu",
  "slug": "main-menu",
  "order": 0,
  "children": [
    {
      "label": "Tools",
      "slug": "tools",
      "order": 0,
      "children": [
        {
          "label": "DNS Tools",
          "slug": "dns-tools",
          "order": 0,
          "login_required": true,
          "children": [
            {
              "label": "DMARC DNS Tools",
              "slug": "dmarc-dns-tools",
              "link": "/dmarc-tools/",
              "title": "DMARC Rulez",
              "order": 0
            }
          ]
        },
        {
          "label": "Password Generator",
          "slug": "password-generator",
          "order": 1
        }
      ]
    },
    {
      "label": "Disabled Item",
      "slug": "disabled-item",
      "order": 1,
      "enabled": false,
      "children": [
        {
          "label": "Disabled child",
          "slug": "disabled-child",
          "order": 0
        }
      ]
    },
    {
      "label": "Perm Item",
      "slug": "perm-item",
      "order": 2,
      "permissions": [
        "add_permission",
        "view_session"
      ]
    }
  ]
}FeaturesMultiple menus supportedVisibility logic: login required / permissionsRender menu tree templatetagsBreadcrumbs templetetagImport a menu from json management commandDjango Batonintegration to highlight different menu in the adminRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.pyDevelopment commandspip install -r requirements_dev.txt
invoke -lExample appThis example is provided as a convenience feature to allow potential users to try the app straight from the app repo without having to create a django project.It can also be used to develop the app in place.To run this example, follow these instructions:Navigate to the root directory of your application (same asmanage.py)Install the requirements for the package:pip install -r requirements_test.txtMake and apply migrationspython manage.py makemigrationspython manage.py migrateRun the serverpython manage.py runserverAccess from the browser athttp://127.0.0.1:8000Admin user account is admin:adminCreditsDjango Lineup is developed by Otto SRL.Tools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.3.1 (2022-12-22)Adds Dajngo 4 support0.3.0 (2021-04-27)Adds the extras field0.2.3 (2021-02-28)Fixes tests0.2.2 (2021-02-28)Fixes baton row attributes method0.2.1 (2020-12-14)Adds order field as editable in change list pageFirst stable release0.2.0 (2020-12-14)First stable release0.1.0 (2020-12-11)First release on PyPI.