Source

django-swingcms / swingcms / custodian / _settings.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _



#######################################
# django-custodian specific settings #
#######################################


AUTHENTICATION_BACKENDS = (
    'custodian.code.ModelBackend',
)

# these are all possible global permissions
GLOBAL_PERMS = (
    ('edit', 'permission'),
    ('edit', 'group'),
    ('edit', 'user'),
    ('edit', '/static/custodian/css/base.css')
)

MODELS_ACTIONS = {
    'permission':('view','add','change','delete'),
    'group':('view','add','change','delete','change status'),
    'user':('view','add','change','delete','change status')
}

ENCRYPT_PASSWORD = True # put False only for development or testing proposalor take attention !!!
TRY_NO_ENCRYPTED = True

SESSION_KEY = '_auth_user_id'

REQUIRE_USER_EMAIL = True
CONFIRM_USER_EMAIL = True
ACTIVE_ON_CONFIRM = True

USER_CONFIRM = _("""

to activate your account for %(domain)s click on:

http://%(domain)s/confirm_email_user/%(username)s/%(token)s

""")


###########################
# swing specific settings #
###########################


ADMIN_OPTIONS = (
    ('edit', 'group', 'permissions', "",  "/edit_groups"),
    ('edit', 'user', 'permissions', "",  "/edit_users"),
    ('edit', '/static/custodian/css/base.css', 'presentation', "", "/edit/text?path=/static/custodian/css/base.css"),
)


###########################################################
# django default settings required from django-custodian #
###########################################################


DEFAULT_LOGIN_REDIRECT = "/"
DEFAULT_LOGOUT_REDIRECT = "/"
DEFAULT_LOGIN_URL = "/login"
DEFAULT_LOGOUT_URL = "/logout"


###########################################
## STATIC FILES IMPORTED IN HEAD SECTION ##
###########################################


TEMPLATES = {
    'user': {
        'add': (
            ("custodian/user_add_form.html", _("user add")),
        ),
        'change': (
            ("custodian/user_change_form.html", _("user change")),
        ),
    },
    'group': {
        'add': (
            ("custodian/group_form.html", _("group add")),
        ),
        'change': (
            ("custodian/group_form.html", _("group change")),
        ),
        'edit': (
            ("custodian/edit_group.html", _("group edit")),
        ),
    },
}

COMMON_CSS_FILES = (
    "custodian/css/base.css",
)

COMMON_JS_FILES = (
)