FILEPICKER_API_KEY = fp_api
+from karmaworld.secret.static_s3 import *
+
+SERIALIZATION_MODULES = {'json-pretty': 'karmaworld.apps.serializers.json_pretty'}
+
+
+########## REQUIRED SECURITY CONFIGURATION
+# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-ALLOWED_HOSTS
+# The hosts that this server runs from.
+ALLOWED_HOSTS = [
+ '127.0.0.1', # for dev systems / VMs, but should be safe enough
+ 'localhost', # for dev systems / VMs, but should be safe enough
+ 'beta.karmanotes.org',
+ 'www.karmanotes.org',
+ 'karmanotes.org',
+]
+########## END SECURITY CONFIGURATION
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
+ 'karmaworld.apps.notes.context_processors.s3_url',
+
+ # allauth specific context processors
+ "allauth.account.context_processors.account",
+ "allauth.socialaccount.context_processors.socialaccount",
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
# Use GZip compression to reduce bandwidth.
'django.middleware.gzip.GZipMiddleware',
+ # Version control middleware.
+ 'reversion.middleware.RevisionMiddleware',
+
# Default Django middleware.
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
# Tagging https://github.com/yedpodtrzitko/django-taggit
'taggit',
+
+ # Version control
+ 'reversion',
+
+ 'allauth',
+ 'allauth.account',
+ 'allauth.socialaccount',
+ # ... include the providers you want to enable:
+ 'allauth.socialaccount.providers.facebook',
+ 'allauth.socialaccount.providers.google',
+ 'allauth.socialaccount.providers.twitter',
+
+ # Added to make quizzes moderation nicer
+ 'nested_inlines',
)
LOCAL_APPS = (
'karmaworld.apps.users',
'karmaworld.apps.moderation',
'karmaworld.apps.licenses',
+ 'karmaworld.apps.quizzes',
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
########## END APP CONFIGURATION
+########## AUTHENTICATION
+
+AUTHENTICATION_BACKENDS = (
+ # Needed to login by username in Django admin, regardless of `allauth`
+ "django.contrib.auth.backends.ModelBackend",
+
+ # `allauth` specific authentication methods, such as login by e-mail
+ "allauth.account.auth_backends.AuthenticationBackend",
+)
+
+ACCOUNT_EMAIL_REQUIRED = True
+ACCOUNT_AUTHENTICATION_METHOD = "email"
+ACCOUNT_CONFIRM_EMAIL_ON_GET = False
+ACCOUNT_EMAIL_VERIFICATION = "optional"
+ACCOUNT_EMAIL_SUBJECT_PREFIX = "KarmaNotes.org -- "
+ACCOUNT_USERNAME_REQUIRED = True
+SOCIALACCOUNT_EMAIL_REQUIRED = True
+SOCIALACCOUNT_EMAIL_VERIFICATION = "optional"
+SOCIALACCOUNT_QUERY_EMAIL = True
+SOCIALACCOUNT_AUTO_SIGNUP = False
+ACCOUNT_USER_DISPLAY = 'karmaworld.apps.users.models.user_display_name'
+ACCOUNT_SIGNUP_FORM_CLASS = 'karmaworld.apps.users.forms.SignupForm'
+ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
+
+AUTH_PROFILE_MODULE = 'users.UserProfile'
+
+######### END AUTHENTICATION
+
########## LOGGING CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
'handlers': {
'console': {
'level': 'INFO',
},
'mail_admins': {
'level': 'ERROR',
+ 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
########## SESSION CONFIGURATION
+SESSION_ENGINE = 'django.contrib.sessions.backends.db'
SESSION_COOKIE_AGE = 63072000 # 2 years in seconds
########## END SESSION CONFIGURATION