Project name inserted automatically in url when using django template url tag

Posted by thebossman on Stack Overflow See other posts from Stack Overflow or by thebossman
Published on 2010-02-03T01:45:28Z Indexed on 2010/04/23 22:03 UTC
Read the original article Hit count: 525

I am applying the 'url' template tag to all links in my current Django project.

I have my urls named like so...

url(r'^login/$', 'login', name='site_login'),

This allows me to access /login at my site's root. I have my template tag defined like so...

<a href="{% url site_login %}">

It works fine, except that Django automatically resolves that url as /myprojectname/login, not /login. Both urls are accessible. Why? Is there an option to remove the projectname? This occurs for all url tags, not just this one.

© Stack Overflow or respective owner

Related posts about django

Related posts about django-templates