djangosnippets.org: Latest snippets posted by ericflohttps://djangosnippets.org/users/ericflo/2009-07-26T14:51:37.619312-05:00ericfloPrint Exceptions to the Console
2009-07-26T14:51:37.619312-05:00ericflohttps://djangosnippets.org/snippets/1654/<p>Put this in an <strong>init</strong>.py somewhere that will be executed on initialization and all errors will be printed out to stderr. Useful for debugging Facebook apps, javascript calls, etc.
</p>
Freely redistributableCase Insensitive Authentication Backend
2009-03-12T15:44:02.008439-05:00ericflohttps://djangosnippets.org/snippets/1368/<p>By enabling this backend:</p>
<pre><code>AUTHENTICATION_BACKENDS = (
'path.to.my.backends.CaseInsensitiveModelBackend',
)
</code></pre>
<p>Your users will now be able to log in with their username, no matter whether the letters are upper- or lower-case.</p>
Freely redistributableUpdate All Apps to Latest Revision
2008-07-01T18:04:48.480575-05:00ericflohttps://djangosnippets.org/snippets/844/<p>A simple script that I have put in my Django applications directory to fetch the latest application code from git and svn.</p>
<p>For example, your directory structure might look like so:</p>
<pre><code>django-apps/
django-tagging/
django-pagination/
django-registration/
django-threadedcomments/
django-mptt/
update_apps.py
</code></pre>
<p>Where update_apps.py is the source of this snippet.</p>
<p>To run, simply execute: …</p>
Freely redistributableSQL Printing Middleware
2007-06-17T00:08:31.945718-05:00ericflohttps://djangosnippets.org/snippets/290/<p>Just put it in your python path and add it into MIDDLEWARE_CLASSES.</p>
<p>I know that there are a couple of snippets on this site that do something similar to this, but none of them quite suited me. </p>
<p>I wanted something that would indent and space the SQL so that I …</p>
Freely redistributablePygments Rendering Template Filter
2007-02-26T16:49:11.969531-06:00ericflohttps://djangosnippets.org/snippets/25/<p>Finds all <code><code></code></code> blocks in a text block and replaces it with pygments-highlighted html semantics. It tries to guess the format of the input, and it falls back to Python highlighting if it can't decide. This is useful for highlighting code snippets on a blog, for instance.</p>
Freely redistributable