djangosnippets.org: Latest snippets posted by matrixhttp://djangosnippets.org/users/matrix/2013-12-17T14:48:42.881052-06:00matrixMultiple emails form field
2013-12-17T14:48:42.881052-06:00matrixhttp://djangosnippets.org/snippets/3012/<p>Validate form field that include email or emails separated by 'token' kwargs, by default ',' a comma. Return a list [] of email(s). Check validity of the email(s) from django EmailField regex (tested with 1.3, but normally will also work with 1.5)</p>
Freely redistributableSpaceless all HTML pages
2012-12-20T14:42:52.423654-06:00matrixhttp://djangosnippets.org/snippets/2867/<p>This middleware remove all space between tags and line break of all HTML pages.
Use a standard Django method. Set <em>force_spaceless</em> for dev. purpose. </p>
Freely redistributablesimple DomainsAliasMiddleware
2009-03-30T08:35:27.659798-05:00matrixhttp://djangosnippets.org/snippets/1403/<p>Permit to redirect desired domain name to the 'domain' of Site app.
Useful if you have different domains name for the same website.
</p>
<h1>1. Add to your settings DOMAINS_ALIAS like this:</h1>
<pre><code>DOMAINS_ALIAS = (
'my-second-domain.com',
'www.my-second-domain.com',
'third-domain.com',
'www.third-domain.com',
)
</code></pre><p>notice: all these domains are redirected to the <strong>domain</strong> db entry …</p>
Freely redistributable