Sephi, you showed me the right way! Thanks! {% url blogapp.posts_by_tag "mytag" %} didn't work, but then I tried {% url blogapp.views.posts_by_tag "mytag" %}, since that function is in views.py file, and got "/blog/tags/mytag/". Yay!
Thank you all for the help! On Jun 6, 9:30 am, Sephi <[EMAIL PROTECTED]> wrote: > Have you tried adding a parameter to the templatetag ? You try to > output the url for the "posts_by_tag" view, but you don't pass any > post tag. In the example you gave from the docs, there's a client id > passed to the templatetag. > > Try the following : {% url blogapp.posts_by_tag 'mytag' %} > > On Jun 5, 8:40 pm, Armandas <[EMAIL PROTECTED]> wrote: > > > Hi, I have problems making {% url %} work. > > > I have this urls.py file in my project directory: > > from django.conf.urls.defaults import * > > > urlpatterns = patterns('root', > > (r'^blog/', include('blogapp.urls')), > > (r'^admin/', include('django.contrib.admin.urls')), > > ) > > > then in my applicatoion folder, another urls.py (which is included in > > first file): > > from django.conf.urls.defaults import * > > > urlpatterns = patterns('blogapp.views', > > (r'^$', 'homepage'), > > (r'^([a-z0-9-]+).html(#[a-z]+)?$', 'post_by_name'), > > (r'^tags/([a-z0-9-]+)/$', 'posts_by_tag'), > > ) > > > Now I'm adding {% url posts_by_tag %} in my template, but it doesn't > > output anything. I also tried the following combinations: > > {% url blogapp.posts_by_tag %} > > {% url blogapp.views.posts_by_tag %} > > > Do you have any suggestions? > > > Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---