On Mon, Dec 3, 2012 at 7:31 AM, Loai Ghoraba <loai1...@gmail.com> wrote: > Hi > > I have this in my urls.py > > url(r'^accounts/login/$', login,name="accounts-login") > > and in a template base.html > <a href="{%url accounts-login%}?next=/somelink/">login</a> > > And when I try to open the site, this error is raised: Template syntax > error: Could not parse the remainder: '-login' from 'accounts-login' > > But when I change the name of the url in both urls.py and base.html to > something without the score '-', it works: like :accountslogin. > > So are scores banned in named urls ? I have seen scored-named-urls in the > documentation !
Hyphens are valid in urls, but not in python. A hyphen is an operator in python (subtraction operator), so you cannot use it in django. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.