djangosnippets.org: Latest snippets tagged with 'anonymous'http://djangosnippets.org/tags/anonymous/2013-07-04T07:13:22.246922-05:00anonymous_required decorator
2013-07-04T07:13:22.246922-05:00yettyhttp://djangosnippets.org/snippets/2969/<p>Decorator to preserve view from logged users.</p>
Freely redistributableSupport for permissions for anonymous users in django ModelBackend
2011-11-08T18:25:59.216496-06:00jbhttp://djangosnippets.org/snippets/2594/<pre><code>Model backend that enables permissions for AnonymusUsers.
I wanted it to be as simple as possible so anonymous users just forward their permission checks
to some fixed user model. This instance can be edited via django admin, assigned to groups, etc.
To control which user will represent anonymous user you …</code></pre>
Freely redistributableNew view decorator to only cache pages for anonymous users
2010-10-07T17:07:04.686144-05:00vaughnkochhttp://djangosnippets.org/snippets/2230/<p>This is an addition to Django's cache_page decorator.
</p>
<p>I wanted to cache pages for anonymous users but not cache the same page for logged in users.
There's middleware to do this at a site-wide level, and it also gives you the ability to partition anonymous users, but then you have …</p>
Freely redistributableUse both NTLM and Anonymous authentication with IIS
2010-07-28T12:19:04.469835-05:00ungenio41http://djangosnippets.org/snippets/2128/<p>Point '^accounts/login/$' or whatever your custom login path is to the 'negotiate_ntlm' view.</p>
<p>This allows you to keep anonymous authentication enabled on IIS and easily lock down just the parts of the site you need to (e.g. <a href="http://djangosnippets.org/snippets/2127/">admin</a>).</p>
Freely redistributablecreate and authenticate an anonymous user
2009-09-12T04:46:55.922351-05:00chr15mhttp://djangosnippets.org/snippets/1723/<p>If you want anonymous visitors to your site, or parts of your site to be authenticated as real users so that you can treat them as such in your views and models, use this snippet. Add the above AuthenticationBackendAnonymous middleware into AUTHENTICATION_BACKENDS in your settings.py and use the snippet anonymous_or_real(request) …</p>
Freely redistributable