django-cas-server/cas_server/default_settings.py

24 lines
949 B
Python
Raw Normal View History

2015-05-16 21:43:46 +00:00
from django.conf import settings
2015-05-17 21:24:41 +00:00
import auth
2015-05-16 21:43:46 +00:00
def setting_default(name, default_value):
value = getattr(settings, name, default_value)
setattr(settings, name, value)
setting_default('CAS_LOGIN_TEMPLATE', 'cas_server/login.html')
setting_default('CAS_WARN_TEMPLATE', 'cas_server/warn.html')
setting_default('CAS_LOGGED_TEMPLATE', 'cas_server/logged.html')
2015-05-17 21:24:41 +00:00
setting_default('CAS_AUTH_CLASS', auth.DjangoAuthUser)
2015-05-16 21:43:46 +00:00
setting_default('CAS_ST_LEN', 30)
setting_default('CAS_TICKET_VALIDITY', 300)
setting_default('CAS_PROXY_CA_CERTIFICATE_PATH', True)
2015-05-17 21:24:41 +00:00
setting_default('CAS_SQL_HOST', 'localhost')
setting_default('CAS_SQL_USERNAME', '')
setting_default('CAS_SQL_PASSWORD', '')
setting_default('CAS_SQL_DBNAME', '')
setting_default('CAS_SQL_DBCHARSET', 'utf8')
setting_default('CAS_SQL_USER_QUERY', 'SELECT user AS usersame, pass AS password, users.* FROM users WHERE user = %s')
setting_default('CAS_SQL_PASSWORD_CHECK', 'crypt') # crypt or plain