Skip to content

Instantly share code, notes, and snippets.

{% formconfig as myconfig %}
{% config row using "forms/rows/p.html" %}
{% config widget widgets.TextInput for forms.CharField %}
...
{% endformconfig %}
{% form myform withconfig myconfig %}
@jacobian
jacobian / direct.txt
Created June 24, 2011 21:41
Downloads of Django by UA
125669 Mozilla
21837 Python-urllib
13620 Wget
2424 Opera
1790 Download Master
1559 FDM 3.x
323 Axel 2.4 (Linux)
261 curl
245 Gnam Gnam Spider
242 Java

Hi Alex

Look, it's reST!

class Media:
script = {
'text/coffeescript': ['one.coffee', 'two.coffee']
}
"""
DB router for Trac. Very simple: just makes sure that all Trac tables are
queries against the "trac" DB alias.
It's very simplistic, leaving off allow_relation and allow_syncdb since all
the Trac apps are unmanaged.
"""
from unipath import FSPath as Path
import re
import inspect
import pygraphviz as pgv
from django.conf import settings; settings.configure()
from django.views import generic
class GenericViewGraph(pgv.AGraph):
_ignore_types = (None, object)
def __init__(self, *args, **kwargs):
import inspect
REQUEST = object()
def super_dec(obj):
if inspect.isclass(obj):
_original_dispatch = obj.dispatch
def _wrapped_dispatch(self, request, *args, **kwargs):
print "calling wrapped CBV-style dispatch"
assert request is REQUEST
diff --git a/django/contrib/auth/decorators.py b/django/contrib/auth/decorators.py
index 5805a31..5d35c0f 100644
--- a/django/contrib/auth/decorators.py
+++ b/django/contrib/auth/decorators.py
@@ -1,10 +1,11 @@
+import inspect
import urlparse
from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
diff --git a/django/contrib/auth/decorators.py b/django/contrib/auth/decorators.py
index 5805a31..a07a4d9 100644
--- a/django/contrib/auth/decorators.py
+++ b/django/contrib/auth/decorators.py
@@ -1,10 +1,11 @@
+import inspect
import urlparse
from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
@jacobian
jacobian / gist:1225209
Created September 18, 2011 16:03
Pre-reqs for Strange Loop Machine Learning workshop - Mac + homebrew + virtualenv
brew install gfortran
mkvirtualenv --no-site-packages stl-mlearning
pip install pyyaml
pip install numpy
pip install scipy
wget http://nltk.googlecode.com/files/nltk-2.0.1rc1.zip
unzip http://nltk.googlecode.com/files/nltk-2.0.1rc1.zip
cd nltk
python setup.py install