django.urls.exceptions.NoReverseMatch: 'xxx' is not a registered namespace

created at 07-17-2021 views: 2

environment

  • django== 2.1.1
  • Render url in html

xx.html

<a href='{% url 'user:role-role_menu_list' %}'></a>

error message

django.urls.exceptions.NoReverseMatch: 'user' is not a registered namespace

Solution

The app name is not added to the urls of the app application

app_name = 'user'
Please log in to leave a comment.