Snippet List
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)
- multiple
- email
- validation
- form
- field
- list
Permit to redirect desired domain name to the 'domain' of Site app.
Useful if you have different domains name for the same website.
#1. Add to your settings DOMAINS_ALIAS like this:
DOMAINS_ALIAS = (
'my-second-domain.com',
'www.my-second-domain.com',
'third-domain.com',
'www.third-domain.com',
)
notice: all these domains are redirected to the **domain** db entry of Site ID.
#2. add all these domains to ServerAlias directive in your vhost apache configuration.
#3. enable the middleware by adding to your MIDDLEWARE_CLASSES:
MIDDLEWARE_CLASSES = (
...
'utils.middleware.domainsalias.DomainsAliasMiddleware',
...
)
- middleware
- redirect
- domain
matrix has posted 3 snippets.