| """ |
| Django settings for tap project. |
| |
| Generated by 'django-admin startproject' using Django 1.8.13. |
| |
| For more information on this file, see |
| https://docs.djangoproject.com/en/1.8/topics/settings/ |
| |
| For the full list of settings and their values, see |
| https://docs.djangoproject.com/en/1.8/ref/settings/ |
| """ |
| |
| # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
| import os |
| from secret import * |
| |
| 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.8/howto/deployment/checklist/ |
| |
| # SECURITY WARNING: keep the secret key used in production secret! |
| SECRET_KEY = MY_SECRET_KEY |
| |
| # SECURITY WARNING: don't run with debug turned on in production! |
| DEBUG = True |
| |
| ALLOWED_HOSTS = ['*'] |
| |
| SITE_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__))) |
| |
| SITE_ID = 1 |
| |
| # Email integration setup |
| EMAIL_USE_TLS = True |
| EMAIL_HOST = 'email-smtp.us-east-1.amazonaws.com' |
| EMAIL_PORT = 587 |
| EMAIL_HOST_USER = 'AKIAJJDM2ZC67STGF4IA' |
| EMAIL_HOST_PASSWORD = MY_EMAIL_PASSWORD |
| |
| # Configurable email addresses |
| # These are addresses where mail is sent from... |
| EMAIL_FROM_NOMINAL_ADDRESS = "onlinetesting@xdataonline.com" |
| EMAIL_FROM_ERROR_ADDRESS = "no-reply@xdataonline.com" |
| # These are addresses used to send mail to... |
| EMAIL_TO_ERROR_ADDRESS = "errors@xdataonline.com" |
| |
| |
| # Application definition |
| |
| INSTALLED_APPS = ( |
| 'grappelli', # must be before django.contrib.admin |
| 'django.contrib.admin', |
| 'django.contrib.auth', |
| 'django.contrib.contenttypes', |
| 'django.contrib.sessions', |
| 'django.contrib.messages', |
| 'django.contrib.sites', |
| 'django.contrib.staticfiles', |
| 'custom_user', |
| 'app_mgr', |
| 'axes', |
| 'rest_framework', |
| 'rest_framework.authtoken', |
| 'guardian', |
| ) |
| |
| MIDDLEWARE_CLASSES = ( |
| 'django.contrib.sessions.middleware.SessionMiddleware', |
| 'django.middleware.common.CommonMiddleware', |
| 'django.middleware.csrf.CsrfViewMiddleware', |
| 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
| 'django.contrib.messages.middleware.MessageMiddleware', |
| 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 'django.middleware.security.SecurityMiddleware', |
| ) |
| |
| ROOT_URLCONF = 'tap.urls' |
| |
| AUTHENTICATION_BACKENDS = ( |
| 'django.contrib.auth.backends.ModelBackend', |
| 'guardian.backends.ObjectPermissionBackend', |
| ) |
| GUARDIAN_MONKEY_PATCH = False |
| |
| AUTH_USER_MODEL = 'app_mgr.UserProfile' |
| |
| REST_FRAMEWORK = { |
| 'DEFAULT_AUTHENTICATION_CLASSES': ( |
| 'rest_framework.authentication.TokenAuthentication', |
| ) |
| } |
| LOGIN_REDIRECT_URL = '/app_mgr/users' |
| |
| TEMPLATES = [ |
| { |
| 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 'DIRS': [os.path.join(SITE_ROOT, 'templates')], |
| '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 = 'tap.wsgi.application' |
| |
| |
| # Database |
| # https://docs.djangoproject.com/en/1.9/ref/settings/#databases |
| |
| DATABASES = { |
| 'default': { |
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
| 'NAME': MY_DB_NAME, |
| 'USER': MY_DB_USER, |
| 'PASSWORD': MY_DB_PASSWORD, |
| 'HOST': 'localhost', |
| 'PORT': '', |
| } |
| } |
| |
| |
| # Internationalization |
| # https://docs.djangoproject.com/en/1.8/topics/i18n/ |
| |
| LANGUAGE_CODE = 'en-us' |
| |
| TIME_ZONE = 'America/New_York' |
| |
| USE_I18N = True |
| |
| USE_L10N = True |
| |
| USE_TZ = True |
| |
| |
| # Static files (CSS, JavaScript, Images) |
| # https://docs.djangoproject.com/en/1.8/howto/static-files/ |
| STATIC_ROOT = os.path.join(BASE_DIR, '../static') |
| |
| STATIC_URL = '/static/' |
| |
| LOGGING = { |
| 'version': 1, |
| 'disable_existing_loggers': True, |
| 'formatters': { |
| 'verbose': { |
| 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' |
| }, |
| }, |
| 'handlers': { |
| 'console': { |
| 'level': 'NOTSET', |
| 'class': 'logging.StreamHandler', |
| 'formatter': 'verbose' |
| } |
| }, |
| 'loggers': { |
| '': { |
| 'handlers': ['console'], |
| 'level': 'NOTSET', |
| }, |
| 'django.request': { |
| 'handlers': ['console'], |
| 'propagate': False, |
| 'level': 'ERROR' |
| } |
| } |
| } |