Reputation: 1095
App1 containing the form, after user fulfills and submits the form, the page will redirect to "Result" which is defined in App2
def input(request):
if request.method == 'POST':
form = Inputform(request.POST)
if form.is_valid():
cd = form.cleaned_data
print (cd['company'])
print (cd['region'])
return HttpResponseRedirect(reverse('result', args=(p.id,)))
The url is as below:
urlpatterns = patterns('',
url(r'^result/$','result.views.resultlist',name='result'),
url(r'^input', 'inputform.views.input',name='input'),
The thing is if I run http://127.0.0.1:8000/result on the browser, it works properly. But once I fulfill the form and click the submit, the page will redirect to:http://127.0.0.1:8000/result.html. And then there is error showing: The current URL, result.html, didn't match any of these.
Any suggestion is highly appreciated. Thanks.
Upvotes: 2
Views: 93