Reverse for '' * '' with arguments '()' and keyword arguments '{}' not found

I am trying to use a tag {% url %}

to send my user to a new template called payment.html. I am getting the error above. Here's what I have:

In some Javascript in my template:

  {% url 'payment' %}

      

In my urls:

  urlpatterns = patterns('',
    (r'media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),

    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^pc-admin/', include(pcAdminSite.urls)),

    (r'^$', index),
    (r'^signup/', signup),
    (r'^info_submit/', info_submit),
    (r'^payment/', payment, name="payment"),

      

In my views:

  def payment(request):
    return render_to_response('payment.html', {})

      

Based on similar posts, I made sure that only 1 url points to my billing view and used named urls. Can anyone help with what I might be doing wrong? Thank.

+3


source to share


2 answers


There should be no ''

surrounding view name in the tag url

- check the documentation . (Unless you're using the Django 1.5 tag future

{% url %}

.)



+6


source


this error also occurs like this:

<a href="{% url 'profiles_profile_detail' user.username %}">My account</a>

      

the message will be as follows:



Reverse for ''profiles_profile_detail'' with arguments '(u'mynick',)' and keyword arguments '{}' not found.

      

as soon as two '' fell, as explained earlier, everything works fine;)

+1


source







All Articles