File: views.py

package info (click to toggle)
django-simple-captcha 0.5.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,336 kB
  • sloc: python: 1,220; makefile: 80; sh: 5
file content (14 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django.http import HttpResponseRedirect
from forms import CaptchaForm
from django.shortcuts import render


def home(request):
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect(request.path + '?ok')
    else:
        form = CaptchaForm()

    return render(request, 'home.html', {'form': form})