Skip to main content

DJANGO OUTBOX MENU

Menu is almost use in every web project.

With this library you can create menu for backend and frontend project without headache. All you need to do is:

In your django Environment

Install package to your environment

> pip install django-outbox-menu

Add to INSTALLED_APPS

INSTALLED_APPS = [        
    'django.contrib.sites', 
    'menu',
]

Add SITE_ID in user settings.py

SITE_ID = 1

Include library URLS

urlpatterns += [
    path('', include('menu.urls')),
]

Install requirements

Activate your environment using
> mkvirtualenv env_menu    

Migrate to create table to your database

> python manage.py migrate

In your django Templates

Load menu tags

> {% load menu_tags %}

Generate menu

> {% menu_create FRONTEND 0 as my_menu %}     
syntax :
    > menu_create <menu_kind> <menu_group> as var_name
    > menu_kind  : FRONTEND or BACKEND
    > menu_group : 
        0 : None (use only for FRONTEND)
        1 : Owner
        2 : Manager
        3 : Operator
        4 : Cashier
        etc ... (Update in admin page section [Menu Groups])

> {% for n in my_menu %}
    n have all menu fields such as :
    n.id
    n.parent_id
    n.name
    n.link
    n.icon
    n.is_external
    n.level
    n.haveChild
    n.haveChildEndTag
    You can use it inside for loop

> example in you templates
    <ul class="main-menu">
        {% menu_create FRONTEND 0 as my_menu %}                    
        {% for n in my_menu %}

            {% if forloop.first %}                      
                <li class="main-menu-active">
            {% else %}
                <li>
            {% endif %}

            {% if n.haveChild %}
                <a href="#"> {{n.name}}
                    {% if n.parent_id %}
                        <i class="zmdi zmdi-chevron-right text-to-right"></i>
                    {% endif %}
                </a>
                <ul class="sub-menu">                            
            {% else %}                                
                <a class="clear-content-right" href="#"> {{n.name}} </a>                            
            {% endif %}
                                                            
            
            {% for i in n.haveChildEndTag %}
                <!-- Count = {{forloop.counter}} -->
                {% if forloop.last %}
                    {% if n.parent_id %}
                        </li></ul>
                        {% if not n.haveChild %}                                                
                            </li> <!-- li -->                            
                        {% endif %}  
                    {% else %}
                        </li> <!-- Root -->
                    {% endif %}

                {% else %}
                    </li></ul>
                {% endif %}       

            {% endfor %}                            
                                        
        {% endfor %}                                        
    </ul> 

Run project

> python manage.py runserver
on you browser :
127.0.0.1:8000
127.0.0.1:8000/menu
127.0.0.1:8000/admin

Metadata

Release files for django-outbox-menu 1.1.30

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-outbox-menu 1.1.30
File Size Uploaded Provenance Actions
django-outbox-menu-1.1.30.tar.gz 626.2 kB Without provenance Details for django-outbox-menu-1.1.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-outbox-menu 1.1.30
File Interpreter ABI Platform Actions
django_outbox_menu-1.1.30-py3-none-any.whl Python 3 none any Details for django_outbox_menu-1.1.30-py3-none-any.whl

Total release size: 1.3 MB

Release files / django-outbox-menu-1.1.30.tar.gz

Download URL django-outbox-menu-1.1.30.tar.gz
Size 626.2 kB
Tags Source
SHA-256 checksum
How to use checksums
eaabb14f1ae77e4f735e97a714f4e55e4ac9cadfee0439d54acb623bd185a81d
BLAKE2b-256 checksum
How to use checksums
f7117666055dd8fa3e8b16ef55b7f900aea999c51da6087e3533082f860b5804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / django_outbox_menu-1.1.30-py3-none-any.whl

Download URL django_outbox_menu-1.1.30-py3-none-any.whl
Size 639.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcb3d3a15ae47f878f670c428bab3ec7b00e925f4f41a12a0853bd17435b2904
BLAKE2b-256 checksum
How to use checksums
c6927d2769b529122a1141edd9744f22ca3291f296dccfa991a44933d56de335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for django-outbox-menu 1.1.30

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

1.1.30 This release

2 release files 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