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
@dstanek
dstanek / gist:1773749
Created February 8, 2012 20:56
My git woes
localbox:~% ssh my-linode-account "git init --bare /tmp/myrepo.git"
dstanek@my-linode-account's password:
Initialized empty Git repository in /tmp/myrepo.git/
localbox:Projects/my_awesome_project% git push ssh://my-linode-account/tmp/myrepo.git master
dstanek@my-linode-account's password:
Counting objects: 162, done.
Compressing objects: 100% (161/161), done.
Writing objects: 100% (162/162), 39.62 KiB, done.
Total 162 (delta 78), reused 0 (delta 0)
To ssh://my-linode-account/tmp/myrepo.git