Skip to main content

Django Urlmapper

Urlmapper is a library for Django to print out the registered urls for a site in a readable format.

Basic Usage

from mysite.urls import urlpatterns
from urlmapper.utils import get_urls

urls = get_urls(urlpatterns)

for entry in urls:
    print(entry["path"], entry["name"], entry["view"])

A urlpattern like:

extra = [
    url("^world/$", view),
]

nested = [
    url(r"^(?P<slug>\w+)/", include([
        url(r"^$", view),
        url(r"^history/$", view),
        url(r"^edit/$", view),
    ])),
]

urlpatterns = [
    url("^$", view),
    url("^product/(?P<slug>[^/]+)/$", view, name="product-detail"),
    url("^about/$", view, name="about"),
    url("^hello/", include(extra)),
    url("^page/", include(nested)),
]

Would output like:

/
/about/
/hello/world/
/page/<slug>/
/page/<slug>/edit/
/page/<slug>/history/
/product/<slug>/

Installation

Urlmapper can be installed from PyPI:

pip install django-urlmapper

Credits

This code was originally modified from the django-extensions library for use in things other than Django management commands.

Metadata

Release files for django-urlmapper 1.1.0

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-urlmapper 1.1.0
File Size Uploaded Provenance
django-urlmapper-1.1.0.tar.gz 2.9 kB Without provenance Details

Release files / django-urlmapper-1.1.0.tar.gz

Download URL django-urlmapper-1.1.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8aeb3f4033155b8912791d8dc7492e423f7a5fbf28ec44e3b1293c68a165002c
BLAKE2b-256 checksum
How to use checksums
11ff8e08a3c5ed4147ad44fe7142d7681209249e34aeed9375c390a097817274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-urlmapper 1.1.0

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.0 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