djangosnippets.org: Latest snippets posted by justquickhttps://djangosnippets.org/users/justquick/2009-02-08T11:21:04.474656-06:00justquickUnit Test Profiling
2009-02-08T11:21:04.474656-06:00justquickhttps://djangosnippets.org/snippets/1315/<p>A test runner for Django unittests which profiles the tests run, and saves the result. Very useful for diagnosing your apps. Place the top portion of the code into a file called <code>profiling.py</code> someplace in your python path. Update your <code>settings.py</code> file with the bottom two lines of the code. …</p>
Freely redistributableUnit Tests That Write Fixtures
2009-02-04T13:26:40.989164-06:00justquickhttps://djangosnippets.org/snippets/1309/<p>This is a skeleton framework of a unittest for an app which will write out a fixture of the test database once the test has been done. I run this once for all apps, but you can limit which apps get serialized by modifying the self.apps value from get_apps (all …</p>
Freely redistributableGoogle Charts Templatetags (Python)
2008-07-01T05:46:13.553344-05:00justquickhttps://djangosnippets.org/snippets/839/<p>The core templatetags for my project <a href="http://code.google.com/p/google-chartwrapper/">google-chartwrapper</a>. It is an easy method of creating dynamic GoogleCharts from the <a href="http://code.google.com/apis/chart/">GoogleChartAPI</a>. To get the most recent version:</p>
<p><code>svn checkout http://google-chartwrapper.googlecode.com/svn/trunk/</code></p>
<p>and run <code>python setup.py</code> in the downloaded trunk directory. There is an included django project there with the <a href="http://code.google.com/p/google-chartwrapper/wiki/ChartExamples">ChartsExamples</a> all …</p>
Freely redistributableGoogle Charts Templatetags (HTML)
2008-04-26T21:31:10.418961-05:00justquickhttps://djangosnippets.org/snippets/726/<p>Example usage of the GChartWrapper.charts module for creating dynamic charts with templatetags. It is an easy method of creating dynamic GoogleCharts from the <a href="http://code.google.com/apis/chart/">GoogleChartAPI</a>. The project is located at <a href="http://code.google.com/p/google-chartwrapper/">google-chartwrapper</a>. To get the most recent version:</p>
<p><code>svn checkout http://google-chartwrapper.googlecode.com/svn/trunk/</code></p>
<p>and run <code>python setup.py</code> in the downloaded trunk directory. …</p>
Freely redistributableUser/IP Banning Middleware
2008-04-26T21:15:29.685437-05:00justquickhttps://djangosnippets.org/snippets/725/<p>Banning middleware with allow,deny functionality. Can select by User id/username and IP addresses. Returns a HttpResponseForbidden when banning requests. Banning by users is real nice because no matter which IP a pest comes from, they can never retrieve anything that they log into. Very handy for keeping out those unwanted …</p>
Freely redistributable