Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am trying to use the {% url %} tag to send my user to a new template, called payment.html. I am receiving 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've made sure that only 1 URL points to my payment view and have used named URLs. Can anyone help with what I might be doing wrong? Thanks.

like image 416
kshen Avatar asked Nov 26 '25 10:11

kshen


2 Answers

There shouldn't be any '' surrounding the view name in the url tag - check the documentation out. (Unless you're using the Django's 1.5 future {% url %} tag.)

like image 151
Thomas Orozco Avatar answered Nov 28 '25 22:11

Thomas Orozco


this error also occurs this way :

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

the message will be this one

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

once the two '' dropped like explain erlier everything works fine ;)