· 6 years ago · Feb 08, 2019, 06:58 PM
1import os
2
3# settings paths that are handy to use other places
4SETTINGS_DIR = os.path.dirname(os.path.realpath(__file__))
5
6BASE_DIR = os.path.join(
7 os.path.abspath(
8 os.path.join(SETTINGS_DIR, os.path.pardir),
9 ),
10)
11
12# django settings for dataentry project.
13DEBUG = True
14
15INTERNAL_IPS = ['127.0.0.1', 'localhost']
16
17ADMINS = (
18 ('Data Desk', 'datadesk@latimes.com'),
19)
20
21MANAGERS = ADMINS
22
23# Local time zone for this installation. Choices can be found here:
24# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25# although not all choices may be available on all operating systems.
26# On Unix systems, a value of None will cause Django to use the same
27# timezone as the operating system.
28# If running in a Windows environment this must be set to the same as your
29# system time zone.
30TIME_ZONE = 'America/Los_Angeles'
31
32# Language code for this installation. All choices can be found here:
33# http://www.i18nguy.com/unicode/language-identifiers.html
34LANGUAGE_CODE = 'en-us'
35
36SITE_ID = 1
37
38# If you set this to False, Django will make some optimizations so as not
39# to load the internationalization machinery.
40USE_I18N = True
41
42# If you set this to False, Django will not format dates, numbers and
43# calendars according to the current locale
44USE_L10N = True
45
46# Absolute path to the directory that holds media.
47# Example: "/home/media/media.lawrence.com/"
48MEDIA_ROOT = ''
49
50# URL that handles the media served from MEDIA_ROOT. Make sure to use a
51# trailing slash if there is a path component (optional in other cases).
52# Examples: "http://media.lawrence.com", "http://example.com/media/"
53MEDIA_URL = ''
54
55# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
56# trailing slash.
57# Examples: "http://foo.com/media/", "/media/".
58ADMIN_MEDIA_PREFIX = '/media/'
59
60STATIC_URL = '/static/'
61STATIC_ROOT = os.path.join(BASE_DIR, '.static')
62STATICFILES_DIRS = ()
63STATICFILES_FINDERS = (
64 'django.contrib.staticfiles.finders.FileSystemFinder',
65 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
66)
67
68# Make this unique, and don't share it with anybody.
69SECRET_KEY = 'q(@ljwv#tj40l5l=fdvc6y7tfl50%e&x5j*1tc)@ot&+9)m5ed'
70
71TEST_RUNNER = "django.test.simple.DjangoTestSuiteRunner"
72
73MIDDLEWARE = (
74 'whitenoise.middleware.WhiteNoiseMiddleware',
75 'django.middleware.common.CommonMiddleware',
76 'django.contrib.sessions.middleware.SessionMiddleware',
77 'django.middleware.csrf.CsrfViewMiddleware',
78 'django.contrib.auth.middleware.AuthenticationMiddleware',
79 'django.contrib.messages.middleware.MessageMiddleware',
80 'social_django.middleware.SocialAuthExceptionMiddleware',
81)
82
83ROOT_URLCONF = 'project.urls'
84
85TEMPLATES = [
86 {
87 'BACKEND': 'django.template.backends.django.DjangoTemplates',
88 'DIRS': [],
89 'APP_DIRS': True,
90 'OPTIONS': {
91 'context_processors': [
92 'django.contrib.auth.context_processors.auth',
93 'django.template.context_processors.request',
94 'social_django.context_processors.backends',
95 'social_django.context_processors.login_redirect',
96 ],
97 },
98 },
99]
100
101INSTALLED_APPS = (
102 'django.contrib.auth',
103 'django.contrib.contenttypes',
104 'django.contrib.sessions',
105 'django.contrib.sites',
106 'django.contrib.sitemaps',
107 'django.contrib.messages',
108 'django.contrib.staticfiles',
109 'django.contrib.admin',
110 'agents',
111 'academy',
112 'nonprofit_990s',
113 'coroner',
114 'toolbox',
115 'social_django',
116 'ois',
117 'food101',
118)
119
120
121try:
122 from .settings_dev import *
123except ImportError:
124 from .settings_prod import *
125
126
127SOCIAL_AUTH_POSTGRES_JSONFIELD = True
128AUTHENTICATION_BACKENDS = [
129 'social_core.backends.slack.SlackOAuth2',
130 'django.contrib.auth.backends.ModelBackend'
131]
132LOGIN_URL = "/login/slack/"
133LOGOUT_URL = '/logout'
134LOGOUT_REDIRECT_URL = '/'
135LOGIN_REDIRECT_URL = '/admin/'
136SOCIAL_AUTH_PIPELINE = (
137 'social_core.pipeline.social_auth.social_details',
138 'social_core.pipeline.social_auth.social_uid',
139 'social_core.pipeline.social_auth.auth_allowed',
140 'social_core.pipeline.social_auth.social_user',
141 'social_core.pipeline.user.get_username',
142 'social_core.pipeline.user.create_user',
143 'social_core.pipeline.social_auth.associate_user',
144 'social_core.pipeline.social_auth.load_extra_data',
145 'social_core.pipeline.user.user_details',
146 'toolbox.social.assign_user_to_staff',
147)
148SOCIAL_AUTH_SLACK_TEAM = 'FOOBAR'