Aldryn Django (core Django)

Aldryn Django (aldryn-django) installs and provides basic configuration for Django.

Key Aldryn Django configuration options

Remove URL language prefix for default language

Set on the Aldryn Django configuration on the Control Panel.

When set, will add the aldryn_django.middleware.LanguagePrefixFallbackMiddleware to the middleware.

This will cause Django not to use a language prefix in the URL when serving the default language. For example, by default, /about will redirect to /en/about if English is the default language; with this option selected, it will not (and will instead redirect in the other direction).

Note that prior to Django version 1.10, this will not work with projects in which multiple languages are defined.

This is a 302 Temporary Redirect, as determined in Django’s core. It is not safe to use permanent redirects here, because language redirects are content-dependent. A change in the site could cause redirect loops, as described at 301 Permanent vs 302 Temporary redirects, or spurious 404 errors.

SECURE_SSL_REDIRECT

When True, redirects to the HTTPS version of the site.

Can be specified as an environment variable (recommended) or in settings.py.

The SECURE_SSL_REDIRECT setting is handled by Django’s SecurityMiddleware.

By default, this is a 302 Temporary Redirect

DOMAIN_REDIRECTS

A list of domain names that will redirect to the site’s primary domain name.

By default, this is populated by the Control Panel. If required, it can also be specified as an environment variable on the Live server (recommended) or in settings.py.

Setting this manually will allow you to add the internal Divio domain of the site, such as example.eu.aldryn.io, to the domains that will redirect to the primary domain. (You may wish to do this if you don’t want users or search engines to discover your site at example.eu.aldryn.io rather than example.com.)

Note that if you specify DOMAIN_REDIRECTS manually, you will need to list all of its secondary domains, as it overrides the setting automatically generated by the Control Panel.

ALDRYN_SITES_REDIRECT_PERMANENT

By default, redirects are 302 Temporary Redirect. When True, redirects (where this is appropriate) will be 301 Permanent Redirect.

Can be specified as an environment variable (recommended) or in settings.py.

See 301 Permanent vs 302 Temporary redirects for more information.

Other options

See aldryn-django.aldryn_config for the settings it takes and how they are applied. (Check that you are referring to the appropriate version.)