Thanks, Tom.

I am not sure how you mean? In the contact_us app, I am not explicitly
calling reverse. I only have the following:

from django.shortcuts import render, reverse

def contact_us(request):
    return render(request, 'contact_us/contact_us.html')




On Tue, Apr 9, 2013 at 4:22 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Tue, Apr 9, 2013 at 2:31 PM, Sithembewena Lloyd Dube
> <zebr...@gmail.com> wrote:
> > Hi everyone,
> >
> > I have a project based on the latest Django version (1.5.1.) where I
> created
> > a contact_us application. The project has a urls.py file with some url
> > patterns. The contact_us app implements its own urls.py file
> (decoupling).
> > In the project's urls.py file (just above the admin site's url pattern),
> i
> > have the following url pattern:
> >
> > url(r'^contact_us/', include('contact_us.urls', namespace="contact_us")),
> >
> > and in the contact_us app's urls.py file, I have the following url
> pattern:
> >
> > urlpatterns = patterns('',
> >     url(r'^$', views.contact_us, name='contact_us'),
> > )
> >
> > In a template residing in the contact_us app's own templates folder, I
> use
> > the url template tag as follows:
> >
> > <a href="{% url 'contact_us' %}">Contact Us</a>
> >
> > resulting in the following exception:
> >
> > NoReverseMatch at /contact_us/
> >
> > Reverse for 'contact_us' with arguments '()' and keyword arguments '{}'
> not
> > found.
> >
> > Any ideas what I could be missing? I namespaced the contact_us urls
> include
> > in the main urls'py file and there is a simple contact_us view in the
> > contact_us app which renders an existing template.
> >
> > Thanks.
>
> You've omitted the namespace when reversing the url. Use
> 'contact_us:contact_us'.
>
> Cheers
>
> Tom
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Regards,
Sithu Lloyd Dube

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to