为什么 NoReverseMatch 出现在 django 2.0 上

Why NoReverseMatch at occurred on django 2.0

错误说:

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

我的代码在下面。

html 错误所在的模板:

{% block more_posts %}<button type="button" href="{% url 'website:list' %}">more posts</button>{% endblock %}

my_project/urls.py:

urlpatterns = [
    re_path(r'^admin/', admin.site.urls),
    re_path(r'^', include('website.urls')),
]

website/urls.py:

app_name = 'website'

urlpatterns = [
    re_path(r'^about/$', TemplateView.as_view(template_name='website/about.html'), name='list'),
    re_path(r'^$', views.main, name='main'),
]

我的 url 命名空间设置有问题吗?

添加命名空间

re_path(r'^', include('website.urls',namespcae="website")),