I have the following URL config in my Django project:
urlpatterns = [
path('', views.record_create),
path('<entry_method>/', views.record_create, name = "record_create"),
]
The view goes:
def record_create(request, entry_method="bulk/"):
In my template I do:
<a href="{% url "record_create" entry_method=request.path_info %}">
And I get the following error:
django.urls.exceptions.NoReverseMatch: Reverse for 'record_create' with keyword arguments '{'entry_method': '/bulk/'}' not found. 1 pattern(s) tried: ['(?P<entry_method>[^/]+)/$']
Not sure what I'm doing wrong. Any suggestions are welcome.