Skip to main content

Easily create navigation for Flask applications.

Project description

Flask-Nav is a Flask-Extension to ease the creation of navigational Elements in Applications. It provides means to Express the Navigational structure and different ways to render these, making it easy to custom tailor it for your application.

A motivating example:

from flask import Flask, render_template
from flask_nav import Nav
from flask_nav.elements import *

nav = Nav()

# registers the "top" menubar
nav.register_element('top', Navbar(
    View('Widgits, Inc.', 'index'),
    View('Our Mission', 'about'),
    Subgroup(
        'Products',
        View('Wg240-Series', 'products', product='wg240'),
        View('Wg250-Series', 'products', product='wg250'),
        Separator(),
        Label('Discontinued Products'),
        View('Wg10X', 'products', product='wg10x'),
    ),
    Link('Tech Support', href='http://techsupport.invalid/widgits_inc'),
))


app = Flask(__name__)
# [...] (view definitions)

nav.init_app(app)

You can find a small, runnable example application inside the example folder. To run it, install Flask-Appconfig and execute:

$ flask --app=example dev

The full documentation can be found on PyPI.

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

flask-nav-0.6.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file flask-nav-0.6.tar.gz.

File metadata

  • Download URL: flask-nav-0.6.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flask-nav-0.6.tar.gz
Algorithm Hash digest
SHA256 44e40b755380a1e68ab521a2f9174de259a2c94ddcdaabf36b3aca2e110a33f4
MD5 4d51cfd06d58f8d0fe85775a6696c0e5
BLAKE2b-256 09540c454eef2e8cf8dd5bc88b1b9490d1e3ecbe365c07458ab4e794ba64231d

See more details on using hashes here.

Supported by

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