django url tag with optional arguments
Project description
Installation
$ [sudo] pip install django-template-url-optional
Examples
settings.py
INSTALLED_APPS = [
...
'django_template_url_optional',
...
]
{% load url_optional %}
<a href="{% url_optional 'item_list' variable %}">
<a href="{% url_optional 'item_list' %}">
urls.py
urlpatterns = [
path('<str:name>/', views.ItemListView.as_view(),name='item_list'),
path('', views.ItemListView.as_view(),name='item_list'),
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-template-url-optional-2020.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e77a58d7179db6e2179acec2ec976e7ee8def9fcdb8256f94040e36e71d3317 |
|
MD5 | cf57946872928720f2a47d075c77204c |
|
BLAKE2b-256 | 38e29b25faea94ceb37a6aab2fe7703a56172bc513c5b743bdd83680c7459d22 |