2014-01-08 6 views
13

私は私のウェブサイト上で動作するように登録ジャンゴ取得しようとしているが、私は、私は、私は、Python 3.3。 0のパターン(複数可)試してみました:[]

にジャンゴ1.6を使用してい

を理解していないこのエラーを得続けます

NoReverseMatch at /accounts/register/ 
Reverse for 'index' with arguments '()' and keyword arguments '{}' not  found. 0 pattern(s) tried: [] 
    Request Method: GET 
Request URL: http://127.0.0.1:8000/accounts/register/ 
Django Version: 1.6.1 
Exception Type: NoReverseMatch 
Exception Value:  
Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 
Exception Location: D:\Programming\Py33\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 429 
Python Executable: D:\Programming\Py33\python.exe 
Python Version: 3.3.3 
Python Path:  
['D:\\Programming\\GItHub\\photobyte\\PhotoByte', 
'D:\\Programming\\Py33\\lib\\site-packages\\setuptools-2.0.3dev-py3.3.egg', 
'C:\\WINDOWS\\SYSTEM32\\python33.zip', 
'D:\\Programming\\Py33\\DLLs', 
'D:\\Programming\\Py33\\lib', 
'D:\\Programming\\Py33', 
'D:\\Programming\\Py33\\lib\\site-packages'] 
Server time: Wed, 8 Jan 2014 02:49:17 -0800 
Error during template rendering 

これはこれは私のpのための私のUrls.pyで14

In template D:\Programming\GItHub\photobyte\PhotoByte\templates\base.html, error at line 14 
Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
5 
6 <head> 
7  <link rel="stylesheet" href="/style.css" /> 
8  <title>{% block title %}User test{% endblock %}</title> 
9 </head> 
10 
11 <body> 
12  <div id="header"> 
13   {% block header %} 
14  <a href="{% url 'index' %}">{% trans "Home" %}</a> | 
15 
16  {% if user.is_authenticated %} 
17  {% trans "Logged in" %}: {{ user.username }} 
18  (<a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a> | 
19  <a href="{% url 'auth_password_change' %}">{% trans "Change password" %}</a>) 
20  {% else %} 
21  <a href="{% url 'auth_login' %}">{% trans "Log in" %}</a> 
22  {% endif %} 
23  <hr /> 
24   {% endblock %} 

ライン文句

そのをerroringされるhtmlコードですメッセージ

urlpatterns = patterns('', 
    (r'^ImageUpload/', include('ImageUpload.urls')), 
    (r'^accounts/', include('registration.backends.default.urls')), 
    (r'^$', RedirectView.as_view(url='/ImageUpload/list/')), # Just for ease of use. 
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 

エラーが何を意味するのか説明できる人がいますか? Djangoはあなたのurls.pyファイル内の「インデックス」という名前のURLを決定することができないので、ライン14号に文句

答えて

15

その。上記の「インデックス」という名前のURLは表示されません。あなたのホームページのURLパターンはどこですか/何ですか?

+0

私はどのようにジャンゴ作品にはかなり新しいです。私はそれがジャンゴ・registration.backends.defualt.urlsに含まれるだろうと思いました。現時点ではホームページはありません。もしそうなら、私はそれはそれにリダイレクトする名前のインデックスを持っていたURLに追加しましたか? –

+1

ええ!(r '^ ImageUpload /'、include( 'ImageUpload.urls'))、 (r '^)のようにurlpatterns = patterns(' '、(家庭、名前= "家"使いやすさのために、 (r '^ $'、RedirectView.as_view(url = '/ ImageUpload/list /'))、# )+ static(settings.MEDIA_URL、document_root = settings.MEDIA_ROOT) – praveen

+0

あなたは素晴らしいです。説明してくれてありがとう:) –

3

URLの一致式はパラメータを持っている場合に発生しますが、テンプレート内の逆で渡さどれも存在しません。

関連する問題