Skip to main content

django-simple-url allows developers to specify Django routes without having to learn the complicated intricacies of regular expressions, and is meant as a drop-in replacement of the native Django url function.

Usage

Using django-simple-url is almost the same as using the native Django url function.

# main/urls.py
from django_simple_url import simple_url

from . import views

urlpatterns = [
    simple_url('', views.index),
    simple_url('posts/<int:id>/', views.post),
]

It also works nicely with other apps, like for instance the Django Admin.

# main/urls.py
from django.contrib import admin
from django_simple_url import simple_url

urlpatterns = [
    url('admin/', admin.site.urls),
]

Caveats

It should be noted that even though the type int appears in the syntax <int:post_id>, the value passed to the view is still a string. The int part of the syntax only limits the URLs that are matched, but does not alter the value passed to the view.

Inspiration

The development of this library is inspired by the following post on the Django mailing list: Challenge teaching Django to beginners: urls.py.

Metadata

Release files for django-simple-url 0.0.1

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-simple-url 0.0.1
File Size Uploaded Provenance Actions
django-simple-url-0.0.1.tar.gz 2.6 kB Without provenance Details for django-simple-url-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-simple-url 0.0.1
File Interpreter ABI Platform Actions
django_simple_url-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_simple_url-0.0.1-py2.py3-none-any.whl

Total release size: 5.9 kB

Release files / django-simple-url-0.0.1.tar.gz

Download URL django-simple-url-0.0.1.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f7c5baebdb5fa9fc1a21ac59db109775fb319d82a766092431965d7b9a8263c8
BLAKE2b-256 checksum
How to use checksums
d9e8b05b78894552761d531910ec1b877fb29d558ba4a2037de583dc4a0b35de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_simple_url-0.0.1-py2.py3-none-any.whl

Download URL django_simple_url-0.0.1-py2.py3-none-any.whl
Size 3.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
94fec2213ce813bb7e6bf9fdeb90cc7b90a63c4de0a4fab624b41ca7abde006e
BLAKE2b-256 checksum
How to use checksums
73b516202cccff6561168233651dcdf1444d5da59575f8e05f2d3f6ebc4d1e4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-simple-url 0.0.1

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.

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