File: views.py

package info (click to toggle)
django-simple-captcha 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: python: 1,596; makefile: 103; sh: 21
file content (15 lines) | stat: -rw-r--r-- 402 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from forms import CaptchaForm  # CustomCaptchaForm

from django.http import HttpResponseRedirect
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})