2016-11-07 3 views
2

私はdjango-registration-reduxを実装しようとしており、Andresによって書かれたテンプレートをhttps://github.com/macdhuibh/django-registration-templatesで利用しています。しかし、問題は私がNoReverseMatchエラーを得る何かを実行するwheverです。NoReverseMatch at/forum/

私はエラーをチェックするためにbase.htmlテンプレートをレンダリングしようとしましたが、私はライン12

上のエラーを持って、index.htmlには

ようです

{% load i18n %} 
<html lang="en"> 

<head> 
    <link rel="stylesheet" href="{{ STATIC_URL }}style.css" /> 
    <title>{% block title %}User test{% endblock %}</title> 
</head> 

<body> 
    <div id="header"> 
    {% block header %} 
    <a href="{% url 'index' %}">{% trans "Home" %}</a> | 

    {% if user.is_authenticated %} 
     {% trans "Logged in" %}: {{ user.username }} 
     (<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a> | 
     <a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a>) 
    {% else %} 
     <a href="{% url 'auth_login' %}">{% trans "Log in" %}</a> 
    {% endif %} 
    <hr /> 
    {% endblock %} 
    </div> 

<div id="content"> 
{% block content %}{% endblock %} 
</div> 

<div id="footer"> 
{% block footer %} 
    <hr /> 
{% endblock %} 
</div> 
</body> 

</html> 

としてbase.htmlがあります

from django.conf.urls import url 
from . import views 

app_name = 'forum' 
urlpatterns = [ 

    url(r'^$', views.index, name='index'), 

] 
として
{% extends "base.html" %} 
{% load i18n %} 

{% block content %} 
Index page 
{% endblock %} 

とurls.py

と下の画像に、私はエラーを取得:

Error

答えて

1

おそらくタグでアプリ名を指定する必要があります。

<a href="{% url 'forum:index' %}">{% trans "Home" %}</a>