Common apps setting mixins

Celery

Celery settings for dev and base production environment.

See http://docs.celeryproject.org/en/latest/configuration.html for settings description.

CeleryBase

class common_configs.apps.celery.CeleryBase
CELERY_TIMEZONE = 'UTC'

Timezone

CELERYD_CONCURRENCY = Value: 12

Env variable: CELERYD_CONCURRENCY

The number of concurrent worker processes/threads/green threads executing tasks.

CELERYD_PREFETCH_MULTIPLIER = Value: 1

Env variable: CELERYD_PREFETCH_MULTIPLIER

How many messages to prefetch at a time multiplied by the number of concurrent processes.

CELERY_RESULT_BACKEND = Value

Env variable: DJANGO_CELERY_RESULT_BACKEND

The backend used to store task results (tombstones). Disabled by default.

CELERY_RESULT_SERIALIZER = Value: 'json'

Env variable: DJANGO_CELERY_RESULT_SERIALIZER

Result serialization format.

BROKER_URL = Value

Env variable: CELERY_BROKER_URL

Default broker URL.

BROKER_POOL_LIMIT = Value: 3

Env variable: CELERY_BROKER_POOL_LIMIT

The maximum number of connections that can be open in the connection pool.

CELERY_IGNORE_RESULT = Value: True

Env variable: DJANGO_CELERY_IGNORE_RESULT

Whether to store the task return values or not (tombstones).

CELERY_MESSAGE_COMPRESSION = 'gzip'

Default compression used for task messages.

CELERY_TASK_RESULT_EXPIRES = 1800.0

Time (in seconds, or a timedelta object) for when after stored task tombstones will be deleted.

CELERY_ACKS_LATE = True

Late ack means the task messages will be acknowledged after the task has been executed, not just before, which is the default behavior. https://docs.celeryproject.org/en/latest/faq.html#faq-acks-late-vs-retry

CELERYD_MAX_TASKS_PER_CHILD = Value: 200

Env variable: DJANGO_CELERYD_MAX_TASKS_PER_CHILD

Maximum number of tasks a pool worker process can execute before it’s replaced with a new one. Default is no limit.

CELERYD_TASK_TIME_LIMIT = Value: 90

Env variable: DJANGO_CELERYD_TASK_TIME_LIMIT

Task hard time limit in seconds. The worker processing the task will be killed and replaced with a new one when this is exceeded.

CELERY_SEND_TASK_ERROR_EMAILS = Value: True

Env variable: DJANGO_CELERY_SEND_TASK_ERROR_EMAILS

Errors occurring during task execution will be sent to ADMINS by email.

CELERYD_HIJACK_ROOT_LOGGER = False
CELERYBEAT_SCHEDULE = {}

CeleryDev

class common_configs.apps.celery.CeleryDev

Bases: common_configs.apps.celery.CeleryBase

CELERY_ALWAYS_EAGER = True

Run queued tasks immediately

CELERY_EAGER_PROPAGATES_EXCEPTIONS = True

Propagate exceptions to front-end debugger

Django Compressor

Assets compression settings for django_compressor

CompressBase

Common settings for production and dev config

class common_configs.apps.compress.CompressBase
COMPRESS_ENABLED = Value: True

Env variable: DJANGO_COMPRESS_ENABLED

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_ENABLED

COMPRESS_PARSER = Value: 'compressor.parser.default_htmlparser.DefaultHtmlParser'

Env variable: DJANGO_COMPRESS_PARSER

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_PARSER

COMPRESS_PRECOMPILERS = [('text/coffeescript', 'coffee --compile --stdio'), ('text/less', 'lessc {infile}'), ('text/x-sass', 'sass {infile} {outfile}'), ('text/x-scss', 'sass --scss {infile} {outfile}'), ('text/stylus', 'stylus < {infile} > {outfile}')]

Predefined list of precompilers. Require installation of 3rd party binaries and packages

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_PRECOMPILERS

COMPRESS_CSS_FILTERS = Value: ['compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.CSSMinFilter']

Env variable: DJANGO_COMPRESS_CSS_FILTERS

List of css filters (rewrite urls and minify output)

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_CSS_FILTERS

COMPRESS_JS_FILTERS = Value: ['compressor.filters.jsmin.JSMinFilter']

Env variable: DJANGO_COMPRESS_JS_FILTERS

List of js filters (minify output)

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_JS_FILTERS

COMPRESS_OUTPUT_DIR = Value: 'cache'

Env variable: DJANGO_COMPRESS_OUTPUT_DIR

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_OUTPUT_DIR

COMPRESS_CACHE_BACKEND = Value: 'locmem'

Env variable: DJANGO_COMPRESS_CACHE_BACKEND

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_CACHE_BACKEND

INSTALLED_APPS

Appends compressor to list of INSTALLED_APPS.

CompressProd

class common_configs.apps.compress.CompressProd

Bases: common_configs.apps.compress.CompressBase

COMPRESS_OFFLINE = Value: True

Env variable: DJANGO_COMPRESS_OFFLINE

Compress assets during deployment

http://django-compressor.rtfd.org/latest/settings/#django.conf.settings.COMPRESS_OFFLINE

CompressDev

class common_configs.apps.compress.CompressDev

Bases: common_configs.apps.compress.CompressBase

COMPRESS_CSS_FILTERS = Value: ['compressor.filters.css_default.CssAbsoluteFilter']

Env variable: DJANGO_COMPRESS_CSS_FILTERS

Don’t minify css in dev

COMPRESS_JS_FILTERS = Value

Env variable: DJANGO_COMPRESS_JS_FILTERS

Don’t minify concatenated js scripts in dev

COMPRESS_CACHE_BACKEND = Value: 'dummy'

Env variable: DJANGO_COMPRESS_CACHE_BACKEND

Don’t cache compiled assets during development

Django Debug Toolbar

DebugToolbar

class common_configs.apps.debugtoolbar.DebugToolbar
MIDDLEWARE_CLASSES

Appends debug_toolbar.middleware.DebugToolbarMiddleware to list of MIDDLEWARE_CLASSES.

INSTALLED_APPS

Appends debug_toolbar to list of INSTALLED_APPS.

Auth

DjangoAuth

class common_configs.apps.auth.DjangoAuth
INSTALLED_APPS

Appends django.contrib.auth to list of INSTALLED_APPS.

MIDDLEWARE_CLASSES

Appends django.contrib.sessions.middleware.SessionMiddleware and django.contrib.auth.middleware.AuthenticationMiddleware to list of MIDDLEWARE_CLASSES.

TEMPLATE_CONTEXT_PROCESSORS

Appends auth context processors to list of TEMPLATE_CONTEXT_PROCESSORS.

PASSWORD_HASHERS = ['django.contrib.auth.hashers.BCryptPasswordHasher', 'django.contrib.auth.hashers.PBKDF2PasswordHasher']

AllAuth

class common_configs.apps.auth.AllAuth

Bases: common_configs.apps.auth.DjangoAuth

INSTALLED_APPS

Appends allauth, allauth.account and allauth.socialaccount to list of INSTALLED_APPS.

TEMPLATE_CONTEXT_PROCESSORS

Appends allauth context processors to list of TEMPLATE_CONTEXT_PROCESSORS.

ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
ACCOUNT_USERNAME_BLACKLIST = ['www', 'ns1', 'ns2', 'ns3', 'ns4', 'ns5', 'dns', 'http', 'https', 'news', 'nntp', 'ftp', 'sftp', 'file', 'mail', 'imap', 'pop3', 'smtp', 'ssh', 'tel', 'admin', 'registration', 'register', 'about', 'help', 'support', 'staff', 'root', 'feed', 'blog', 'noreply', 'media', 'static']
AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend', 'allauth.account.auth_backends.AuthenticationBackend']

Django Crispy Forms

Settings for django-crispy-forms - the best way to have DRY Django forms

CrispyForms

class common_configs.apps.forms.CrispyForms

Bases: object

CRISPY_TEMPLATE_PACK = Value: 'bootstrap3'

Env variable: DJANGO_CRISPY_TEMPLATE_PACK

Template pack

CRISPY_FAIL_SILENTLY = BooleanValue

Env variable: DJANGO_CRISPY_FAIL_SILENTLY

Don’t suppress errors unless explicitly set

INSTALLED_APPS

Appends crispy_forms to list of INSTALLED_APPS.

Django Image Kit

Imagekit

Settings for django-imagekit - automated image processing for Django

class common_configs.apps.imagekit.Imagekit
IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = Value: 'imagekit.cachefiles.strategies.Optimistic'

Env variable: IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY

Use optimistic strategy

http://django-imagekit.rtfd.org/latest/configuration.html#django.conf.settings.IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY

IMAGEKIT_SPEC_CACHEFILE_NAMER = Value: 'imagekit.cachefiles.namers.source_name_dot_hash'

Env variable: IMAGEKIT_SPEC_CACHEFILE_NAMER

Define naming strategy

http://django-imagekit.rtfd.org/latest/configuration.html#django.conf.settings.IMAGEKIT_SPEC_CACHEFILE_NAMER

INSTALLED_APPS

Appends imagekit to list of INSTALLED_APPS.

Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.