Skip to content

Instantly share code, notes, and snippets.

View asadawan's full-sized avatar

Asad Awan asadawan

  • San Francisco
  • 13:55 (UTC -07:00)
View GitHub Profile
@asadawan
asadawan / handler.py
Created July 13, 2011 18:18
A base view handler for djano projects. Gives lots of utils and lets you use classes for handling views. It also extracts query parms from requests to args saving you on lots of if-conditions in the view code.
'''
@author: asad k awan
@copyright: asad k awan
@license: Apache
'''
import re
from django.http import HttpResponse, HttpResponseBadRequest
from django.db.models.query import QuerySet
@asadawan
asadawan / runDocTests.py
Created January 7, 2011 09:18
Run doctests in django environment for any given file or files in a directory
#! /usr/bin/env python -Wall
"""
Run doctests from a given set of modules in django environment.
@author: Asad
@license: BSD
"""
import os, sys, glob
from sys import stderr