djangosnippets.org: Latest snippets posted by dipankarsarkarhttps://djangosnippets.org/users/dipankarsarkar/2008-11-16T00:55:13.279901-06:00dipankarsarkarRemoving all the extra comment fields
2008-11-16T00:55:13.279901-06:00dipankarsarkarhttps://djangosnippets.org/snippets/1195/<p>This helps you remove the extra comments fields from appearing in the form. If you used just form they would appear. This is for Django 1.0 + only.
</p>
<p>By <a href="http://dipankar.name">Dipankar Sarkar</a>
<a href="http://desinerd.com">Blog</a>
me@dipankar.name
</p>
Freely redistributableHTTP authentication using your ModelBackend
2008-11-15T09:06:14.787925-06:00dipankarsarkarhttps://djangosnippets.org/snippets/1192/<p>Save this file as httpauth.py. This example should help you guys out for sure.</p>
<pre><code>from httpauth import *
@logged_in_or_basicauth()
def temp_view(request):
pass
</code></pre>
<p>Feel free to contact me in case you need help.
By <a href="http://dipankar.name">Dipankar sarkar</a>
me@dipankar.name</p>
Freely redistributableUsing another memcached for sessions
2008-11-15T09:01:00.195816-06:00dipankarsarkarhttps://djangosnippets.org/snippets/1191/<p>This solves the problem of losing sessions data when you restart memcached. So you use a different memcached instance for sessions which you rarely restart.</p>
<p>Use the above code and add the following to you settings.py</p>
<pre><code>SESSION_ENGINE = "kwippyproject.session_backend"
SESSION_CACHE = 'memcached://127.0.0.1:11200/'
</code></pre>
<p>(Above assumes that your session's memcached is running …</p>
Freely redistributable