python - Cannot find view : NoReverseMatch error -


i new python , django , working on project build , learning understand adding new views.

application uses templateviews , created view other views created. url pattern kind of same urls working fine. new page created not working , giving me error.

working urls:

urls.py:

**

url(r'^aboutxyz/$', templateview.as_view(template_name="aboutxyz.html"), name='about_xyz'), url(r'^contactus/$', templateview.as_view(template_name="contactus.html"), name='contact_us'), 

**

base.html:

**

<li><a href="{% url 'about_xyz' %}">about xyz</a></li> <li><a href="{% url 'contact_us' %}">contact us</a></li> 

**

these 2 pages working fine. when add this:

urls.py:

url(r'^aboutxyzsg/$', templateview.as_view(template_name="aboutxyzsg.html"), name='about_xyz_sg'),

base.html:

"<li><a href="{% url 'about_xyz_sg' %}">about xyz sg</a></li>"

here code urls.py file contains url_patterns:

urlpatterns = patterns('',     url(r'^grappelli/', include('grappelli.urls')),  # grappelli urls     url(r'^admin/', include(admin.site.urls)), )  urlpatterns += i18n_patterns(     '',      # zinnia-tinymce     url(r'^tinymce/', include('tinymce.urls')),     url(r'^tinymce/zinnia/', include('zinnia_tinymce.urls')),      # index (home)     url(r'^$', index.as_view(), name="main_page"),      # all-auth account     url(r'^accounts/', include('allauth.urls')),      # custom user     url(r'^accounts/', include('users.urls')),      # privacy policy     url(r'^privacypolicy/$', templateview.as_view(template_name="privacypolicy.html"), name='privacy_policy'),      # xyz     url(r'^contactus/$', templateview.as_view(template_name="contactus.html"), name='contact_us'),     url(r'^aboutxyz/$', templateview.as_view(template_name="aboutxyz.html"), name='about_xyz'),     url(r'^aboutxyzsg/$', templateview.as_view(template_name="aboutxyzsg.html"), name='about_xyz_sg'),  ) 

it not working , giving me error:

my error log shows: "noreversematch: reverse 'about_xyz_sg' arguments '()' , keyword arguments '{}' not found. 0 pattern(s) tried: []"

please me in deep trouble

p.s. - tried putting aboutxyzsg url pattern before aboutxyz , still same error


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -