<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Chris Pratt - Latest Comments in A Django Snippet to Refresh Your Database</title><link>http://chrisdpratt.disqus.com/</link><description></description><atom:link href="https://chrisdpratt.disqus.com/a_django_snippet_to_refresh_your_database/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 18 Dec 2008 21:47:41 -0000</lastBuildDate><item><title>Re: A Django Snippet to Refresh Your Database</title><link>http://www.chrisdpratt.com/2008/02/27/a-django-snippet-to-refresh-your-database/#comment-4969682</link><description>&lt;p&gt;&lt;a href="http://code.google.com/p/django-command-extensions/wiki/InstallationInstructions" rel="nofollow noopener" target="_blank" title="http://code.google.com/p/django-command-extensions/wiki/InstallationInstructions"&gt;http://code.google.com/p/dj...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Pach</dc:creator><pubDate>Thu, 18 Dec 2008 21:47:41 -0000</pubDate></item><item><title>Re: A Django Snippet to Refresh Your Database</title><link>http://www.chrisdpratt.com/2008/02/27/a-django-snippet-to-refresh-your-database/#comment-4969681</link><description>&lt;p&gt;Slight correction to first comment (from Keats) - there's a typo - it should be "loaddata" (double d).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bomboze</dc:creator><pubDate>Fri, 27 Jun 2008 05:50:08 -0000</pubDate></item><item><title>Re: A Django Snippet to Refresh Your Database</title><link>http://www.chrisdpratt.com/2008/02/27/a-django-snippet-to-refresh-your-database/#comment-4969680</link><description>&lt;p&gt;Well, I feel a little stupid ;). But that's why I posted this. Thanks for the tips.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Pratt</dc:creator><pubDate>Tue, 18 Mar 2008 17:03:28 -0000</pubDate></item><item><title>Re: A Django Snippet to Refresh Your Database</title><link>http://www.chrisdpratt.com/2008/02/27/a-django-snippet-to-refresh-your-database/#comment-4969679</link><description>&lt;p&gt;you could have done it with a shell script &lt;br&gt;like this :&lt;br&gt;#!/bin/sh&lt;br&gt;./&lt;a href="http://manage.py" rel="nofollow noopener" target="_blank" title="manage.py"&gt;manage.py&lt;/a&gt; dumpdata &amp;gt;&amp;gt; blabla.json&lt;br&gt;./&lt;a href="http://manage.py" rel="nofollow noopener" target="_blank" title="manage.py"&gt;manage.py&lt;/a&gt; flush&lt;br&gt;./&lt;a href="http://manage.py" rel="nofollow noopener" target="_blank" title="manage.py"&gt;manage.py&lt;/a&gt; loadata blabla.json&lt;/p&gt;&lt;p&gt;or simply by adding a setting&lt;br&gt;FIXTURE_DIRS = (&lt;br&gt;    '/home/keats/fixtures',&lt;br&gt;)&lt;/p&gt;&lt;p&gt;then ./&lt;a href="http://manage.py" rel="nofollow noopener" target="_blank" title="manage.py"&gt;manage.py&lt;/a&gt; dumpdata &amp;gt;&amp;gt; /home/keats/fixtures/initial_data.json&lt;/p&gt;&lt;p&gt;now each time you call : &lt;br&gt;./&lt;a href="http://manage.py" rel="nofollow noopener" target="_blank" title="manage.py"&gt;manage.py&lt;/a&gt; flush&lt;br&gt;it will flush the database and automatically reload the data in the initial_data.json &lt;br&gt;the name of the file is important&lt;/p&gt;&lt;p&gt;you can also add sql directory in application directory &lt;br&gt;the syntax is sql/model_name.json or .sql &lt;br&gt;and it will be loaded each time you flush your database&lt;/p&gt;&lt;p&gt;++&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Keats</dc:creator><pubDate>Tue, 11 Mar 2008 08:30:07 -0000</pubDate></item></channel></rss>