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.12.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11a538acafda6612af3f2a641729c1173509d81f5c9886877410b5b3de8484bc |
|
MD5 | 0cac0afaf204ccf7177b45c3a02a6f0f |
|
BLAKE2b-256 | e169d6c99f63fd55409389964db13102962bb5bcf3b31101c92b213fe7743cd7 |