carom-server/caromserver/settings.py

170 lines
4.5 KiB
Python
Raw Normal View History

2017-01-03 18:57:11 +01:00
"""
Django settings for caromserver project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '@-9++2z_6%^vr(f0wax0aq8-pd@0u$*))w!5l^sv#wxrn7k!v-'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
2017-01-06 20:15:29 +01:00
ALLOWED_HOSTS = ['*']
2017-01-03 18:57:11 +01:00
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
2017-01-03 19:11:21 +01:00
'rest_framework',
'rest_framework.authtoken',
2017-02-04 06:20:46 +01:00
'crispy_forms',
2018-02-10 13:44:14 +01:00
'widget_tweaks',
2017-01-03 19:32:53 +01:00
'billard',
2017-01-03 18:57:11 +01:00
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'caromserver.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
2018-02-10 13:44:14 +01:00
'DIRS': [
os.path.join(BASE_DIR, 'templates')
],
2017-01-03 18:57:11 +01:00
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'caromserver.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/
2017-01-03 19:32:53 +01:00
LANGUAGE_CODE = 'de-DE'
2017-01-03 18:57:11 +01:00
2017-01-03 19:32:53 +01:00
TIME_ZONE = 'Europe/Berlin'
2017-01-03 18:57:11 +01:00
USE_I18N = True
USE_L10N = True
2017-02-11 10:23:03 +01:00
USE_TZ = False
2017-01-03 18:57:11 +01:00
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATIC_URL = '/static/'
2018-02-10 13:44:14 +01:00
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'staticfiles')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
2017-01-03 19:11:21 +01:00
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
2017-01-09 19:00:03 +01:00
],
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
2017-01-06 20:15:29 +01:00
}
2017-01-09 07:27:22 +01:00
2018-02-10 13:44:14 +01:00
CRISPY_TEMPLATE_PACK = 'bootstrap4'
2017-02-04 06:20:46 +01:00
LOGIN_URL = 'login'
LOGOUT_URL = 'logout'
2017-04-27 14:35:04 +02:00
LOGIN_REDIRECT_URL = 'billard:location_index'
LOGOUT_REDIRECT_URL = 'billard:location_index'
2017-02-04 06:20:46 +01:00
2017-02-11 11:29:07 +01:00
# Admin eMails
ADMINS = (
('Robert Einsle', 'robert@einsle.de'),
)
2018-02-10 13:44:14 +01:00
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
2017-02-11 11:29:07 +01:00
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_HOST = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 25
2017-02-06 18:50:10 +01:00
2017-02-11 18:59:42 +01:00
URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
2017-01-09 07:27:22 +01:00
try:
from local_settings import *
except ImportError:
pass
2017-01-09 08:18:44 +01:00
try:
from caromserver.local_settings import *
except ImportError:
pass