Settings

Project

A settings file to import boilerplate from.

crudlfap.settings.CRUDLFAP_VIEWS

List of default views to provide to Routers that were not spawned with any view.

crudlfap.settings.INSTALLED_APPS

That list contains both CRUDLFAP_APPS and DJANGO_APPS and you can use them as such on a new project:

from crudlfap.settings import INSTALLED_APPS

INSTALLED_APPS = ['yourapp'] + INSTALLED_APPS
crudlfap.settings.CRUDLFAP_APPS

List of apps CRUDLFA+ depends on, you can use it as such:

from crudlfap.settings import CRUDLFAP_APPS

INSTALLED_APPS = [
    'yourapp',
    'django.contrib.staticfiles',
    # etc
] + CRUDLFAP_APPS
crudlfap.settings.DJANGO_APPS

This list contains all contrib apps from the Django project that CRUDLFA+ should depend on. You can use it as such:

from crudlfap.settings import CRUDLFAP_APPS, DJANGO_APPS

INSTALLED_APPS = ['yourapp'] + CRUDLFAP_APPS + DJANGO_APPS
crudlfap.settings.TEMPLATES

This list contains both DEFAULT_TEMPLATE_BACKEND and CRUDLFAP_TEMPLATE_BACKEND and works out of the box on an empty project. You can add it to your settings file by just importing it:

from crudlfap.settings import TEMPLATES
crudlfap.settings.CRUDLFAP_TEMPLATE_BACKEND

Configuration for Jinja2 and environment expected by CRUDLFA+ default templates. Add it to your own TEMPLATES setting using import:

from crudlfap.settings import CRUDLFAP_TEMPLATE_BACKEND

TEMPLATES = [
    # YOUR_BACKEND
    CRUDLFAP_TEMPLATE_BACKEND,
]
crudlfap.settings.DEFAULT_TEMPLATE_BACKEND

Configuration for Django template backend with all builtin context processors. You can use it to define only your third backend as such:

from crudlfap.settings import (
    CRUDLFAP_TEMPLATE_BACKEND,
    DEFAULT_TEMPLATE_BACKEND,
)

TEMPLATES = [
   # YOUR_BACKEND
   CRUDLFAP_TEMPLATE_BACKEND,
   DEFAULT_TEMPLATE_BACKEND,
]
crudlfap.settings.DEBUG

Evaluate DEBUG env var as boolean, False by default.

crudlfap.settings.SECRET_KEY

Get SECRET_KEY env var, or be 'notsecret' by default.

Danger

Raises an Exception if it finds both SECRET_KEY=notsecret and DEBUG=False.

crudlfap.settings.ALLOWED_HOSTS

Split ALLOWED_HOSTS env var with commas, or be ['*'] by default.

Danger

Raises an Exception if it finds both ALLOWED_HOSTS to be '*' and DEBUG=False.

crudlfap.settings.MIDDLEWARE

A default MIDDLEWARE configuration you can import.

crudlfap.settings.OPTIONAL_APPS

from crudlfap.settings import * # […] your settings install_optional(OPTIONAL_APPS, INSTALLED_APPS) install_optional(OPTIONAL_MIDDLEWARE, MIDDLEWARE)