Error: Django - NoReverseMatch at ...

이다연·2021년 3월 16일
0

Django

목록 보기
16/33

https://stackoverflow.com/questions/45724006/django-reverse-for-not-found-is-not-a-valid-view-function-or-pattern-na

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

  1. The syntax for specifying url is {% url namespace:url_name %}. So, check if you have added the app_name in urls.py.

  2. In my case, I had misspelled the url_name. The urls.py had the following content path('<int:question_id>/', views.detail, name='question_detail') whereas the index.html file had the following entry

    <li><a href="{% url 'polls:detail' question.id %}">
    {{ question.question_text }}</a></li>


{{item.title}} ```
profile
Dayeon Lee | Django & Python Web Developer

1개의 댓글

comment-user-thumbnail
2024년 3월 28일

The error message "Reverse for bloxd io'' not found. '' is not a valid view function or pattern name" typically occurs when there is an issue with specifying the URL in Django templates.

답글 달기