Django Form Submit Url Not Working
I'm new to Django and cannot figure out why my form is not working. It seems that after form submit even though the url is being changed to /82nsj/update it is still going to the i
Solution 1:
It's probably an issue with your url(...
regex.
Django will go to the first URL that matches so if you have this
url(r'^business/(?P<token>\w+)/', 'business.views.index', name='business'),
url(r'^business/(?P<token>\w+)/update/', 'business.views.update', name='business_update'),
going to /business/<token>/anything_goes_here
will always go to business.views.index
.
To stop this, include a $
for end of expression
.
url(r'^business/(?P<token>\w+)/$', 'business.views.index', name='business'),
Now your /business/<token>/update/
wont match the first URL and will then match business.views.update
.
Post a Comment for "Django Form Submit Url Not Working"