Skip to content

Instantly share code, notes, and snippets.

@dstanek
dstanek / gist:4381225
Last active December 10, 2015 04:28 — forked from anonymous/gist:4381219
from myapp.forms import MyForm
def my_view(request):
form = MyForm(request.POST or None)
if form.is_valid():
name = form.cleaned_data['name']
email = form.cleaned_data['email']
# do something great with that data
@dstanek
dstanek / test_quick.py
Created September 28, 2012 21:04 — forked from moschlar/test_quick.py
Badass speedup of simple tg site tests
# -*- coding: utf-8 -*-
"""
This test module will run setUp and tearDown only *once* for all test cases in this module.
This is very convenient for users who want to just test multiple urls whether they are reachable and respond with the correct http response code.
"""
import logging
log = logging.getLogger(__name__)
from os import path