views:

292

answers:

3

why doesn't {% url myVar %} where myVar = 'jack.johnson' doesn't work ?

The view is fine, the urls.py is: url(r'^(?P[A-Za-z0-9-._]+)/$', overview, name='user_profile'),

+1  A: 

Because the URL name is 'user_profile', not 'jack.johnson'.

Daniel Roseman
+1  A: 

Confirm that you're using at least Django 1.0 (named url patterns didn't exist before then), re-read the Django doc on Naming URL Patterns, then try

{% url user_profile myVar %}
Dave W. Smith
+1  A: 

guys, sorry. I found my mistake and the example I gave was misleading. Thanks for the quick response.

Tudorizer