On Tuesday, April 7, 2015 at 9:19:17 AM UTC-7, donarb wrote:
>
> I'm having a problem with a generated url using the url template tag, 
> currently using Django 1.6.5.
>
> The appname is 'dashboard', here is the main urls.py:
>
> urlpatterns = patterns("",
>     (r'^dashboard/', include('dashboard.urls', namespace='dashboard')),
> )
>
>
>
> Here is the dashboard urls.py:
>
> # dashboard/urls.py
> urlpatterns = patterns("",
>     (r'^players/', include('players.urls', namespace='players')),
> )
>
>
> Here is the players urls.py:
>
> # dashboard/players/urls.py
> urlpatterns = patterns("",
>     url(r'^search/?', views.PlayerSearchView.as_view(), name='search'),
> )
>
>
>
> When I code this in the template:
>
> {% url "dashboard:players:search" %}
>
>
>
> I get this url:
>
> /dashboard/playerssearch
>
>
> Any idea why there is no path separator between 'players' and 'search'?
>


Just to follow up, I found the problem. The search url pattern had an 
optional trailing '/', so it was not creating the url correctly. Once I 
removed the optional from the regex, it worked. 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a86d7bed-046a-4097-b607-5a6d7d6ecbd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to