<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/django</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 10:01:21 GMT</pubDate>
<item>
<title>(Django) How to read \"_id\" field of an object in django templates - viroide</title>
<link>http://snipplr.com/view/71446/how-to-read-id-field-of-an-object-in-django-templates/</link>
<description><![CDATA[ <p>It's imposible to read de "_id" field en django templates ( {{element._id}} === error) So, to read it, you must do a templatetag. 

Now you hace the templatetag, you can use it like this: {{element|pk}}</p> ]]></description>
<pubDate>Fri, 07 Jun 2013 21:14:25 GMT</pubDate>
<guid>http://snipplr.com/view/71446/how-to-read-id-field-of-an-object-in-django-templates/</guid>
</item>
<item>
<title>(Django) reset django admin password - techpop</title>
<link>http://snipplr.com/view/71420/reset-django-admin-password/</link>
<description><![CDATA[ <p>lost your django admin password?  here's how to reset it.</p> ]]></description>
<pubDate>Thu, 06 Jun 2013 15:28:17 GMT</pubDate>
<guid>http://snipplr.com/view/71420/reset-django-admin-password/</guid>
</item>
<item>
<title>(Django) telecineplay Error log - novazoo</title>
<link>http://snipplr.com/view/66518/telecineplay-error-log/</link>
<description><![CDATA[ <p>Just an error log from TelecinePlay.
Please..  don't share error logs in public..</p> ]]></description>
<pubDate>Fri, 03 Aug 2012 14:21:30 GMT</pubDate>
<guid>http://snipplr.com/view/66518/telecineplay-error-log/</guid>
</item>
<item>
<title>(Django) Override the change_view in the admin - magicrebirth</title>
<link>http://snipplr.com/view/62778/override-the-changeview-in-the-admin/</link>
<description><![CDATA[ <p>Adding another button with name "addnextid" would trigger our custom action, that redirects the user to the changeform screen for the next available item (by ID).

Then you can override admin/submit_line.html. Copy the version in contrib.admin.templates into your project. Mine is myproject/templates/admin/submit_line.html, but you could use /myproject/myapp/templates/admin/submit_line.html.

Next, edit the copy and add the code for showing the 'Save and edit next item (by ID)' link, which is caught via the "_addnextid" name. 

p.s.
The submit_line.html template is called in change_form.html via the {% submit_row %} tag.</p> ]]></description>
<pubDate>Thu, 26 Jan 2012 04:35:50 GMT</pubDate>
<guid>http://snipplr.com/view/62778/override-the-changeview-in-the-admin/</guid>
</item>
<item>
<title>(Django) Django: 3 ways to serve templates in views.py - chrisaiv</title>
<link>http://snipplr.com/view/62232/django-3-ways-to-serve-templates-in-viewspy/</link>
<description><![CDATA[ <p>There are so many ways to serve templates within views.py that sometimes it's hard to get a handle on which is ideal for a project.  This snippet does not attempt to explain every possible way to serve a template, simply a few I've found helpful organized from low-level (more code) to high-level (less code)</p> ]]></description>
<pubDate>Tue, 03 Jan 2012 03:36:32 GMT</pubDate>
<guid>http://snipplr.com/view/62232/django-3-ways-to-serve-templates-in-viewspy/</guid>
</item>
<item>
<title>(Django) Clean up expired django.contrib.session\'s in a huge MySQL InnoDB table - magicrebirth</title>
<link>http://snipplr.com/view/62190/clean-up-expired-djangocontribsessions-in-a-huge-mysql-innodb-table/</link>
<description><![CDATA[ <p>While django provides the django_admin.py cleanup script, if sessions get out of control sometimes you have to go lower level to get everything cleaned up. If the problem gets out of hand and you hit the resource limits of the machine, it is very difficult to get anything done in the database.

Attached is SQL code which was used to cleanup 27GB of expired session data in 3h. Run it like this to make sure it runs to completion:

`nohup mysql --user=username --password=password --host=hostname database < delete_expired_sessions.sql`

nohup causes the script to run detached from a terminal, so if your session gets disconnected it will keep running.

p.s.
An alternative approach is to launch this command from the shell:

DELETE FROM django_session WHERE expire_date < NOW();

or 

DELETE FROM django_session WHERE expire_date < "2011-12-10 00:00:00";</p> ]]></description>
<pubDate>Fri, 30 Dec 2011 23:12:12 GMT</pubDate>
<guid>http://snipplr.com/view/62190/clean-up-expired-djangocontribsessions-in-a-huge-mysql-innodb-table/</guid>
</item>
<item>
<title>(Django) Django: Configuring settings.py to rely on relative paths rather than absolute - chrisaiv</title>
<link>http://snipplr.com/view/62113/django-configuring-settingspy-to-rely-on-relative-paths-rather-than-absolute/</link>
<description><![CDATA[ <p>Hate absolute Paths? Me too, I always end up forgetting to change things around when I go into production mode.  Thankfully, there's a nice, clean way to have Python do all the hard work.</p> ]]></description>
<pubDate>Sat, 24 Dec 2011 03:24:17 GMT</pubDate>
<guid>http://snipplr.com/view/62113/django-configuring-settingspy-to-rely-on-relative-paths-rather-than-absolute/</guid>
</item>
<item>
<title>(Django) Adding request object info to a template - magicrebirth</title>
<link>http://snipplr.com/view/60684/adding-request-object-info-to-a-template/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 10 Nov 2011 10:36:28 GMT</pubDate>
<guid>http://snipplr.com/view/60684/adding-request-object-info-to-a-template/</guid>
</item>
<item>
<title>(Django) Django: check whether an object already exists before adding - magicrebirth</title>
<link>http://snipplr.com/view/59359/django-check-whether-an-object-already-exists-before-adding/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 03 Oct 2011 21:49:28 GMT</pubDate>
<guid>http://snipplr.com/view/59359/django-check-whether-an-object-already-exists-before-adding/</guid>
</item>
<item>
<title>(Django) Getting Random objects from a Queryset in Django - magicrebirth</title>
<link>http://snipplr.com/view/57053/getting-random-objects-from-a-queryset-in-django/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 23 Jul 2011 01:15:14 GMT</pubDate>
<guid>http://snipplr.com/view/57053/getting-random-objects-from-a-queryset-in-django/</guid>
</item>
<item>
<title>(Django) Convert the time.struct_time object into a datetime.datetime object: - magicrebirth</title>
<link>http://snipplr.com/view/56927/convert-the-timestructtime-object-into-a-datetimedatetime-object/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 20 Jul 2011 23:41:06 GMT</pubDate>
<guid>http://snipplr.com/view/56927/convert-the-timestructtime-object-into-a-datetimedatetime-object/</guid>
</item>
<item>
<title>(Django) Django if statement &amp;amp; loop - stewartduffy</title>
<link>http://snipplr.com/view/55083/django-if-statement--loop/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 09 Jun 2011 16:15:05 GMT</pubDate>
<guid>http://snipplr.com/view/55083/django-if-statement--loop/</guid>
</item>
<item>
<title>(Django) Adding custom django package to WSGI settings - magicrebirth</title>
<link>http://snipplr.com/view/54284/adding-custom-django-package-to-wsgi-settings/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 24 May 2011 00:05:01 GMT</pubDate>
<guid>http://snipplr.com/view/54284/adding-custom-django-package-to-wsgi-settings/</guid>
</item>
<item>
<title>(Django) Remove duplicates from a list - magicrebirth</title>
<link>http://snipplr.com/view/51688/remove-duplicates-from-a-list/</link>
<description><![CDATA[ <p>Not only is it really really fast; it's also order preserving and supports an optional transform function</p> ]]></description>
<pubDate>Thu, 07 Apr 2011 04:06:46 GMT</pubDate>
<guid>http://snipplr.com/view/51688/remove-duplicates-from-a-list/</guid>
</item>
<item>
<title>(Django) request: get multiple values | Django - magicrebirth</title>
<link>http://snipplr.com/view/51125/request-get-multiple-values--django/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 26 Mar 2011 00:27:34 GMT</pubDate>
<guid>http://snipplr.com/view/51125/request-get-multiple-values--django/</guid>
</item>
<item>
<title>(Django) Strip/Remove HTML tags (django utils) - magicrebirth</title>
<link>http://snipplr.com/view/50835/stripremove-html-tags-django-utils/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 19 Mar 2011 05:52:44 GMT</pubDate>
<guid>http://snipplr.com/view/50835/stripremove-html-tags-django-utils/</guid>
</item>
<item>
<title>(Django) Relative paths in Django settings - miloshadzic</title>
<link>http://snipplr.com/view/50141/relative-paths-in-django-settings/</link>
<description><![CDATA[ <p>Relative paths, usually used in settings.py.</p> ]]></description>
<pubDate>Sun, 06 Mar 2011 00:07:29 GMT</pubDate>
<guid>http://snipplr.com/view/50141/relative-paths-in-django-settings/</guid>
</item>
<item>
<title>(Django) Edit TEMPLATE_CONTEXT_PROCESSORS in your settings.py - caruso_g</title>
<link>http://snipplr.com/view/47789/edit-templatecontextprocessors-in-your-settingspy/</link>
<description><![CDATA[ <p>Instead of directly edit your TEMPLATE\_CONTEXT\_PROCESSORS, import it in your app's settings.py and just append what you need.

(credits: denysonique and all #django channel community)</p> ]]></description>
<pubDate>Mon, 24 Jan 2011 19:22:11 GMT</pubDate>
<guid>http://snipplr.com/view/47789/edit-templatecontextprocessors-in-your-settingspy/</guid>
</item>
<item>
<title>(Django) Django tut Blog Settings.py 1 - Affix</title>
<link>http://snipplr.com/view/47121/django-tut-blog-settingspy-1/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 14 Jan 2011 11:49:17 GMT</pubDate>
<guid>http://snipplr.com/view/47121/django-tut-blog-settingspy-1/</guid>
</item>
<item>
<title>(Django) New Sentry Log-entry - schneck</title>
<link>http://snipplr.com/view/44374/new-sentry-logentry/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 19 Nov 2010 00:09:51 GMT</pubDate>
<guid>http://snipplr.com/view/44374/new-sentry-logentry/</guid>
</item>
</channel>
</rss>