there is no pattern named "index" (name="index") so, no reverse match
also, if you planned to work with django in future, i suggest you to use
new-style url template tag like so:
{% load url form future %}
...
{% url 'index' %}
...
On Saturday, May 11, 2013 5:14:02 AM UTC+4, Hu Shizhi wrote:
>
> My urls.py:
>
> from django.conf.urls import patterns, include, url
> # from django.contrib.auth import login, logout
>
>
> # Uncomment the next two lines to enable the admin:
>
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> # url(r'^$', 'patient.views.home', name='home'),
>
> url(r'^accounts/', include('registration.backends.default.urls')),
> # url(r'^register/$', 'patient.views.register'),
>
> # url(r'^login/$', 'login', name='login'),
>
> # url(r'^logout/$', 'logout'),
>
> # url(r'^patient/', include('patient.urls')),
>
>
> # Uncomment the admin/doc line below to enable admin documentation:
>
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
>
> # Uncomment the next line to enable the admin:
>
> url(r'^admin/', include(admin.site.urls)),
> )
>
> On Friday, May 10, 2013 11:22:08 PM UTC+8, C. Kirby wrote:
>>
>> Do you have a urls.py file? To used the url tag with a name you need to
>> have a defined url with that name, example:
>>
>> urlpatterns = patterns('',
>> url(r'^$', 'app.views.index', name="index"),
>> )
>>
>> On Friday, May 10, 2013 9:38:27 AM UTC-5, Hu Shizhi wrote:
>>>
>>> Hi,
>>>
>>> I am new to Django and am using django-registration and followed the
>>> quickstart.rst document and get the following. Could anyone kindly help?
>>>
>>> Thanks,
>>>
>>> Tian
>>>
>>> NoReverseMatch at /accounts/login/
>>>
>>> Reverse for 'index' with arguments '()' and keyword arguments '{}' not
>>> found.
>>>
>>> Request Method:GETRequest URL:http://127.0.0.1:8000/accounts/login/Django
>>> Version:1.4Exception Type:NoReverseMatchException Value:
>>>
>>> Reverse for 'index' with arguments '()' and keyword arguments '{}' not
>>> found.
>>>
>>> Exception
>>> Location:/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/django/template/defaulttags.py
>>>
>>> in render, line 424Python Executable:
>>> /Users/apple/.virtualenvs/health/bin/pythonPython Version:2.7.1Python
>>> Path:
>>>
>>> ['/Users/apple/projects/misc/health',
>>>
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
>>>
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg',
>>>
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/redis-2.7.3-py2.7.egg',
>>>
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/readline-6.2.4.1-py2.7-macosx-10.7-intel.egg',
>>> '/Users/apple/.virtualenvs/health/lib/python27.zip',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/plat-darwin',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/plat-mac',
>>>
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/plat-mac/lib-scriptpackages',
>>> '/Users/apple/.virtualenvs/health/Extras/lib/python',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/lib-tk',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/lib-old',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/lib-dynload',
>>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
>>>
>>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
>>>
>>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
>>>
>>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
>>>
>>> '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages',
>>> '/Users/apple/.virtualenvs/health/lib/python2.7/site-packages/PIL']
>>>
>>> Server time:Fri, 10 May 2013 22:29:17 +0800
>>> Error during template rendering
>>>
>>> In template
>>> /Users/apple/projects/misc/health/patient/templates/base.html, error at
>>> line *14*
>>> Reverse for 'index' with arguments '()' and keyword arguments '{}' not
>>> found.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 %}
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.