djangosnippets.org: Latest snippets posted by brondsemhttps://djangosnippets.org/users/brondsem/2009-04-21T17:37:34.933099-05:00brondsemdumpdata/loaddata with MySQL and ForeignKeys, as django command
2009-04-21T17:37:34.933099-05:00brondsemhttps://djangosnippets.org/snippets/1457/<p>Based on <a href="http://www.djangosnippets.org/snippets/662/">http://www.djangosnippets.org/snippets/662/</a> and updated to be runnable as custom django management command. Also added option support for --exclude=someapp --exclude=otherapp.SomeModel</p>
<p>From original description:
InnoDB tables within MySQL have no ability to defer reference checking until after a transaction is complete. This prevents most dumpdata/loaddata cycles unless the dump order falls …</p>
Freely redistributableA few jinja2 filters like django ones
2009-03-13T17:22:37.569348-05:00brondsemhttps://djangosnippets.org/snippets/1371/<p>Some of this is modified from <a href="http://www.djangosnippets.org/snippets/1062/">http://www.djangosnippets.org/snippets/1062/</a></p>
Freely redistributablemonkey-patch django to use jinja2 templates for 404/500 pages and 3rd-party apps
2009-03-13T17:17:46.725362-05:00brondsemhttps://djangosnippets.org/snippets/1370/<p>This is heavily inspired by <a href="http://code.google.com/p/smorgasbord/">http://code.google.com/p/smorgasbord/</a>. But that couldn't reuse an existing jinja2 Environment, nor set filters on the Environment it created.</p>
<p>This code assumes that you have <code>env</code> declared previously in the file as your Jinja2 Environment instance.</p>
<p>In <code>settings.py</code>, you should set</p>
<pre><code>KEEP_DJANGO_TEMPLATES = (
'/django/contrib/', …</code></pre>
Freely redistributable