This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
settings.py
executable file
·155 lines (113 loc) · 3.88 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
"""
Django settings for xdata project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from secret import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os, sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(BASE_DIR, "op_tasks"))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/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
TEMPLATE_DEBUG = True
# ADMINS = ADMIN_EMAILS
ALLOWED_HOSTS = ['*']
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
SITE_ID = 1
TEMPLATE_DIRS = (
os.path.join(SITE_ROOT, 'templates'),
)
# Application definition
INSTALLED_APPS = (
'custom_user',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
'op_tasks',
'exp_portal',
'developer',
'uploads',
'axes', # Throttling capabilities
)
MIDDLEWARE_CLASSES = (
'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',
'axes.middleware.FailedLoginMiddleware',
)
ROOT_URLCONF = 'xdata.urls'
WSGI_APPLICATION = 'xdata.wsgi.application'
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
AUTH_USER_MODEL = 'custom_user.EmailUser'
# AUTH_PROFILE_MODULE = 'op_tasks.UserProfile'
# AUTH_USER_MODEL = 'op_tasks.MyUser'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, '../db', 'db.sqlite3'),
#}
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'xdatadb',
'USER': 'xdatauser',
'PASSWORD': 'Dr@perUs3r!',
'HOST': 'localhost', #'127.0.0.1', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.6/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.6/howto/static-files/
# STATIC_ROOT = "/var/www/html/stout/static/"
STATIC_ROOT = os.path.join(BASE_DIR, '../static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
LOGIN_URL = '/tasking/login'
CRISPY_TEMPLATE_PACK = 'bootstrap3'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
# 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"
# After three failed logins, require users to wait 5 minutes before they can attempt to log in again
AXES_LOGIN_FAILURE_LIMIT = 3
from datetime import timedelta
AXES_COOLOFF_TIME=timedelta(seconds = 300)
# Activity Logging Endpoint
ALE_URL = 'http://52.20.48.202'