djangosnippets.org: Latest snippets posted by robbiehttp://djangosnippets.org/users/robbie/2007-04-15T13:51:06.949609-05:00robbieReferer-checking view decorators
2007-04-15T13:51:06.949609-05:00robbiehttp://djangosnippets.org/snippets/179/<p>Here are a couple of Django decorators for limiting access to a view based on the request's <code>HTTP_REFERER</code>. Both raise a Django <code>PermissionDenied</code> exception if the referer test fails (or a referer simply isn't provided).
</p>
<p>The first, <code>referer_matches_hostname</code>, takes a hostname (and port, if specified) and matches it …</p>
Freely redistributableClient-side Django-style date & time string formatting
2007-03-06T07:01:27.959819-06:00robbiehttp://djangosnippets.org/snippets/84/<p>This is a reasonably straight forward port of functionality provided by the <code>django.utils.dateformat</code> module into a method extending JavaScript's Date object. Its intended use is to allow client-side dynamic content to share the same date & time string formatting as Django template markup. By using this in conjunction with a …</p>
Freely redistributable