Questions tagged [django-url-reverse]

77 questions
0
votes
1 answer

Removed model instances and error "NoReversematch"

I am encountering the error message similar to this post here. However, I received this message only after I have done the following steps to my django model instances, particularly in the admin. I have a model, called "Product". In admin, I create…
Tristan Tran
  • 1,351
  • 1
  • 10
  • 36
0
votes
1 answer

Reverse for 'userprofile' not found. 'userprofile' is not a valid view function or pattern name

When i write in urls.py app_name = 'user_homeview' then occure error in header.html how i solve this error can you tell me i couldn't solve error yet please tell me..in below html file where wrote href="{%url 'userprofile' i.user %}" in code…
user13772527
0
votes
1 answer

How to fix no reverse match error in Ajax

I am trying to use Ajax to submit a like button without getting the page refreshing, I have been getting several errors previously but now I am getting this error: django.urls.exceptions.NoReverseMatch: Reverse for 'like_post' with arguments '('',)'…
A_K
  • 731
  • 3
  • 15
  • 40
0
votes
0 answers

REST framework basename missing in reversing action url

I have this viewset with a custom action added @permission_classes([IsStaffUser]) class MacroViewSet(viewsets.ModelViewSet): queryset = Macro.objects.all() serializer_class = MacroSerializer http_method_names = ['get', 'post', 'patch',…
0
votes
1 answer

NoReverseMatch at /each_product/1/

I have an anchor tag in an html template as : View In urls.py i have set up the url path as follow for this: path("each_product//", views.each_product, name="each_product") And in view…
Sudip Adhikari
  • 157
  • 2
  • 12
0
votes
1 answer

Why do I get a No Reverse Match error in this case?

So, this is what's going on: I am able to get a blog post in my Django 2.1 app by its primary key. However, by demand of the marketing team, I was asked to put a slug on the URL, so instead of /blog/1, I should get /blog/my-blog-post-title. Thus,…
0
votes
2 answers

No reverse match in Django when passing in a query argument

I am trying to pass a query argument into a Django view through the URL, like so: 127.0.0.1:8000/vysledky/?a_id=1 However, whenever I try to go to that URL, it gives me a NoReverseMatch error. The full error report is listed below: Request Method:…
0
votes
1 answer

How to redirect from one question to another having same forignkey (quiz name)

I m building quiz app I have 3 models ( Quiz, Question,Answers) Question foreign key with Quiz,and Answee foreign key with Questions. I m successful in showing each question on separate page according to their pk. But to redirect from one question…
0
votes
0 answers

Can't redirect to category list url - django

I can't figure out how can I redirect to category list page but url is working fine i just can't add correct redirect url by id into href tag :( html

Categories

    {% for…
abs_ronnie
  • 15
  • 6
0
votes
0 answers

Shopping Cart total price problem in Django

Hi I'm trying to develop an online store website using Django and I don't know why, but my price counter is not working. It was working all fine before I added some pagination, and now it's not adding all the values.Can anyone please help me out? My…
user13080604
0
votes
1 answer

How to pass an ID into a Django template and retrieve data

I am getting stuck passing an id into the template. Here is my views.py file def add_academy(request,pk): child=get_object_or_404(Child_detail,pk=pk) academy=Academic.objects.filter(Student_name=child) context={ …
0
votes
0 answers

Passing parameter from one view to another

My problem is rather simple, I need to pass a value from one view to another without the visitor being able to see the value in the URL. Here is my code : views.py def home(request, message=None): plats = Plat.objects.all() return…
Julien Mertz
  • 465
  • 2
  • 8
  • 22
0
votes
3 answers

django url _reverse _ not a valid view function or pattern name

the redirect url is "liveinterviewList/2" and, ofcourse, I declare that url in url.py more over, when I type that url in browser manualy, it works well. what's the matter? more question. at this case, I write the user_id on the url. I think, it is…
0
votes
2 answers

Django causing noReverseMatch even with correct namespacing

I have the below urlpatterns in the root's url.py: urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^api/', include('api.urls'), name="api_app"), ] where api app contains: app_name="api_app" urlpatterns = [ url(r'^users/',…
bcsta
  • 1,963
  • 3
  • 22
  • 61
-1
votes
2 answers

i am not able to render my urls in my template it gives me error rendering

NoReverseMatch at / Reverse for 'Jersey' with no arguments not found. 1 pattern(s) tried: ['Jersey/(?P[^/]+)/$'] Below is the code to my views.py class JerseyView(TemplateView): #paginate_by=3 template_name='Ecommerce/Jersey.html' …