Note that there are some explanatory texts on larger screens.

plurals
  1. POA weird Django error
    text
    copied!<p>This is my views.py: </p> <pre><code># Create your views here. from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.db import models from display.forms import CodeForm from display.forms import CodeFormSet from ExamPy.questions.models import QuestionBase def codepost(request): if request.method == 'POST': form = CodeFormSet(request.POST) if form.is_valid(): titles = [] for i in range(0, self.total_form_count()): form = self.forms[i] title = form.cleaned_data['title'] if title in titles: raise forms.ValidationError("Articles in a set must have distinct titles.") titles.append(title) return render_to_response('quesdisplay.html') else: form = CodeFormSet() return render_to_response('quesdisplay.html', {'form':form}) </code></pre> <p>Thus, when I click on submit button, it should show the quesdisplay.html without any form in it. But, it is taking me to some contact page which doesn't even exist. </p> <p>Error:</p> <pre><code>The current URL, contact/, didn't match any of these. </code></pre> <p>I've tried all possible ways to debug this but its not possible as there is no trace of anything called "contact" in this. </p> <p>Edit: This is the warning I get:</p> <pre><code>/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py:101: UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext. warnings.warn("A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext.") [10/Nov/2011 05:34:17] " </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload