Questions tagged [django-url-reverse]
77 questions
226
votes
21 answers
How can I list urlpatterns (endpoints) on Django?
How can I see the current urlpatterns that "reverse" is looking in?
I'm calling reverse in a view with an argument that I think should work, but doesn't. Any way I can check what's there and why my pattern isn't?

interstar
- 26,048
- 36
- 112
- 180
4
votes
1 answer
Django. How to get URL by its name?
I want to get url by name specified in urls.py.
Like {% url 'some_name' %} in template, but in Python.
My urls.py:
urlpatterns = [
...
path('admin_section/transactions/', AdminTransactionsView.as_view(), name='admin_transactions'),
…

UselessFire
- 53
- 1
- 6
3
votes
1 answer
passing url parameters using custom url converter in django
I am getting this error when I use my custom url converter
Reverse for 'user-update' with keyword arguments '{'pk': 'Rwdr4l3D'}' not found. 1 pattern(s) tried: ['users/(?P[a-zA-Z0-9](8,))/update/\\Z']
Question:
why isn't the pk matching the…

Dante
- 165
- 8
3
votes
1 answer
Reverse for 'tagged' with arguments '('',)' not found. 1 pattern(s) tried: ['^tag/(?P[-\w]+)/$']
I keep getting this error message:
Reverse for 'tagged' with arguments '('',)' not found. 1 pattern(s) tried: ['\^tag/\(\?P(?P[^/]+)\[\-\\w\]\+\)/\$$']
when trying to load my base.html, because of an anchor tag.
I have looked at other posts with…

Renaldo
- 57
- 3
- 6
3
votes
2 answers
The current path,didn't match any of these
I have this in urls.py
urlpatterns = [
path("product///",views.viewProduct),
]
But when I try to click on the url. I got this error.
The current path,…

suraj sharma
- 415
- 4
- 14
2
votes
1 answer
Django Forms - redirect after save
I have a detail view with 2 forms and here I provide code for only one of them. The form is located in a modal on user detailed view and I need to redirect the client to that detail view in which the form is. In the post method the…

kakakakakakakk
- 467
- 10
- 31
2
votes
2 answers
How to pass object by id after saving from form using redirect?
I am sorry for asking this. I described a service that uploads an image through a form. The bottom line is that after a successful download (add_picture), I have to get to the image page (picture_detail). I don’t understand why I can’t transfer ID.…

Echo Foe
- 398
- 1
- 2
- 16
2
votes
1 answer
Django URL tag not working - NoReverseMatch
I know we aren't supposed to use stackoverflow for debugging but i've been trying to fix this in the last 10 hours and I feel hopeless, my apologies.
#main project urls.py:
urlpatterns = [
...
path('accounts/',include('employee.urls')),
…

Lucas VB
- 29
- 4
2
votes
1 answer
NoReverseMatch error . Reverse for '...' not found
I was trying to implement dynamic urls in Django when this occured
In my template.py, I added this line
Go to Index
My urls.py
from django.contrib import admin
from django.urls import path,…

Heisenberg
- 475
- 8
- 24
2
votes
2 answers
Reverse for 'delete_task/{{todo.id}}' not found. 'delete_task/{{todo.id}}' is not a valid view function or pattern name
I am new in django and I have following issue after running:
Reverse for 'delete_task/{{todo.id}}' not found. 'delete_task/{{todo.id}}' is not a valid view function or pattern name.
In my template file index.html I have:
2
votes
1 answer
NoReverseMatch error for download file page
I am working on a django web application. Here the web app generates a pandas dataframe when a form is submitted. This dataframe is stored in the root directory. I have another view that is used for downloading the generated csv file. But when I…

Sashaank
- 880
- 2
- 20
- 54
1
vote
1 answer
reverse url django admin
small problem of Django and its reverse url,
I try to have a link from a model to another model in the same admin:app
I have this function to run reverse('admin:jobs_xml_jobboardexterne')
I run from this page admin/jobs_xml/countjobboarderrors/
and…

jordan
- 13
- 3
1
vote
3 answers
NoReverseMatch: Reverse for 'delete_url' with arguments '('',)' not found. 1 pattern(s) tried: ['delete_url/(?P[0-9]+)\\Z']
Hi I'm getting an error when I run my code. I am trying to create a delete function on my webpage.
Thank you for your time.
My code is as follows:
home.html : error is in the href tag
{% for web in webs_list %}
…

meister
- 31
- 5
1
vote
1 answer
Django "NoReverseMatch: Reverse for 'ads.views.AdListView' not found" while doing Test
I implemented some tests to check the status code of some pages, but this one with the reverse function throws me the error: django.urls.exceptions.NoReverseMatch: Reverse for 'ads.views.AdListView' not found. 'ads.views.AdListView' is not a valid…

materialAres
- 37
- 6
1
vote
1 answer
In my Django project I have two similar url
I have a question with my sites urls. When someone want to go mysite.com I redirect them to mysite.com/register.
url(r'^$', RedirectView.as_view(url='register/', permanent=False),…

Ahmet Yılmaz
- 71
- 5