[Fixed]-Routing not working for my AJAX request

1👍

In your urls.py

You don’t have a multiplier for slug1

url(r'^potato/(?P<slug1>[-\w]+)/(?P<slug2>[-\w]+)/potatoajax/$', views.potatoajax, name='potatoajax'),

And your views will accept two more arguments as.

def potatoajax(request, slug1, slug2):
  print 'Potato Ajax'
  if request.method == 'POST':
    print 'more potatoes'
  else:
    print 'dont print Potato AJax'

Leave a comment