|
53 | 53 |
|
54 | 54 | # Application definition
|
55 | 55 | INSTALLED_APPS = [
|
56 |
| - 'corsheaders', |
57 |
| - 'django.contrib.admin', |
58 |
| - 'django.contrib.auth', |
59 |
| - 'django.contrib.contenttypes', |
60 |
| - 'django.contrib.sessions', |
61 |
| - 'django.contrib.messages', |
62 |
| - 'whitenoise.runserver_nostatic', |
63 |
| - 'django.contrib.staticfiles', |
64 |
| - 'storages', |
65 |
| - 'social_django', |
66 |
| - 'cookielaw', |
67 |
| - 'django.contrib.humanize', |
68 |
| - 'django.contrib.sitemaps', |
69 |
| - 'django.contrib.sites', |
70 |
| - 'django_extensions', |
71 |
| - 'easy_thumbnails', |
72 |
| - 'app', |
73 |
| - 'avatar', |
74 |
| - 'retail', |
75 |
| - 'rest_framework', |
76 |
| - 'bootstrap3', |
77 |
| - 'marketing', |
78 |
| - 'economy', |
79 |
| - 'dashboard', |
80 |
| - 'enssubdomain', |
81 |
| - 'faucet', |
82 |
| - 'tdi', |
83 |
| - 'gas', |
84 |
| - 'github', |
85 |
| - 'legacy', |
86 |
| - 'chartit', |
87 |
| - 'email_obfuscator', |
88 |
| - 'linkshortener', |
89 |
| - 'credits', |
90 |
| - 'gitcoinbot', |
91 |
| - 'external_bounties', |
92 |
| - 'dataviz', |
93 |
| - 'ethos', |
| 56 | + 'corsheaders', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', |
| 57 | + 'django.contrib.sessions', 'django.contrib.messages', 'whitenoise.runserver_nostatic', 'django.contrib.staticfiles', |
| 58 | + 'storages', 'social_django', 'cookielaw', 'django.contrib.humanize', 'django.contrib.sitemaps', |
| 59 | + 'django.contrib.sites', 'django_extensions', 'easy_thumbnails', 'app', 'avatar', 'retail', 'rest_framework', |
| 60 | + 'bootstrap3', 'marketing', 'economy', 'dashboard', 'enssubdomain', 'faucet', 'tdi', 'gas', 'github', 'legacy', |
| 61 | + 'chartit', 'email_obfuscator', 'linkshortener', 'credits', 'gitcoinbot', 'external_bounties', 'dataviz', 'ethos', |
94 | 62 | 'impersonate',
|
95 | 63 | ]
|
96 | 64 |
|
97 | 65 | MIDDLEWARE = [
|
98 |
| - 'corsheaders.middleware.CorsMiddleware', |
99 |
| - 'django.middleware.security.SecurityMiddleware', |
100 |
| - 'whitenoise.middleware.WhiteNoiseMiddleware', |
101 |
| - 'django.contrib.sessions.middleware.SessionMiddleware', |
102 |
| - 'django.middleware.locale.LocaleMiddleware', |
103 |
| - 'django.middleware.common.CommonMiddleware', |
104 |
| - 'django.middleware.csrf.CsrfViewMiddleware', |
105 |
| - 'django.contrib.auth.middleware.AuthenticationMiddleware', |
106 |
| - 'django.contrib.messages.middleware.MessageMiddleware', |
107 |
| - 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
108 |
| - 'ratelimit.middleware.RatelimitMiddleware', |
109 |
| - 'social_django.middleware.SocialAuthExceptionMiddleware', |
| 66 | + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.security.SecurityMiddleware', |
| 67 | + 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', |
| 68 | + 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', |
| 69 | + 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 70 | + 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 71 | + 'ratelimit.middleware.RatelimitMiddleware', 'social_django.middleware.SocialAuthExceptionMiddleware', |
110 | 72 | 'impersonate.middleware.ImpersonateMiddleware',
|
111 | 73 | ]
|
112 | 74 |
|
|
119 | 81 | 'django.contrib.auth.backends.ModelBackend',
|
120 | 82 | )
|
121 | 83 |
|
122 |
| -TEMPLATES = [ |
123 |
| - { |
124 |
| - 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
125 |
| - 'DIRS': [ |
126 |
| - 'retail/templates/', |
127 |
| - 'external_bounties/templates/', |
128 |
| - 'dataviz/templates', |
| 84 | +TEMPLATES = [{ |
| 85 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 86 | + 'DIRS': ['retail/templates/', 'external_bounties/templates/', 'dataviz/templates', ], |
| 87 | + 'APP_DIRS': True, |
| 88 | + 'OPTIONS': { |
| 89 | + 'context_processors': [ |
| 90 | + 'django.template.context_processors.debug', 'django.template.context_processors.request', |
| 91 | + 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', |
| 92 | + 'app.context.insert_settings', 'social_django.context_processors.backends', |
| 93 | + 'social_django.context_processors.login_redirect', |
129 | 94 | ],
|
130 |
| - 'APP_DIRS': True, |
131 |
| - 'OPTIONS': { |
132 |
| - 'context_processors': [ |
133 |
| - 'django.template.context_processors.debug', |
134 |
| - 'django.template.context_processors.request', |
135 |
| - 'django.contrib.auth.context_processors.auth', |
136 |
| - 'django.contrib.messages.context_processors.messages', |
137 |
| - 'app.context.insert_settings', |
138 |
| - 'social_django.context_processors.backends', |
139 |
| - 'social_django.context_processors.login_redirect', |
140 |
| - ], |
141 |
| - }, |
142 | 95 | },
|
143 |
| -] |
| 96 | +}, ] |
144 | 97 |
|
145 | 98 | SITE_ID = env.int('SITE_ID', default=1)
|
146 | 99 | WSGI_APPLICATION = env('WSGI_APPLICATION', default='app.wsgi.application')
|
|
151 | 104 |
|
152 | 105 | # Password validation
|
153 | 106 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
|
154 |
| -AUTH_PASSWORD_VALIDATORS = [ |
155 |
| - { |
156 |
| - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
157 |
| - }, |
158 |
| - { |
159 |
| - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
160 |
| - }, |
161 |
| - { |
162 |
| - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
163 |
| - }, |
164 |
| - { |
165 |
| - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
166 |
| - }, |
167 |
| -] |
| 107 | +AUTH_PASSWORD_VALIDATORS = [{ |
| 108 | + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 109 | +}, { |
| 110 | + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 111 | +}, { |
| 112 | + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 113 | +}, { |
| 114 | + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 115 | +}, ] |
168 | 116 |
|
169 | 117 | REST_FRAMEWORK = {
|
170 | 118 | # Use Django's standard `django.contrib.auth` permissions,
|
|
323 | 271 | SOCIAL_AUTH_GITHUB_SECRET = GITHUB_CLIENT_SECRET
|
324 | 272 | SOCIAL_AUTH_POSTGRES_JSONFIELD = True
|
325 | 273 | SOCIAL_AUTH_ADMIN_USER_SEARCH_FIELDS = ['username', 'first_name', 'last_name', 'email']
|
326 |
| -SOCIAL_AUTH_GITHUB_SCOPE = [ |
327 |
| - 'read:public_repo', |
328 |
| - 'read:user', |
329 |
| - 'user:email', |
330 |
| -] |
| 274 | +SOCIAL_AUTH_GITHUB_SCOPE = ['read:public_repo', 'read:user', 'user:email', ] |
331 | 275 |
|
332 | 276 | SOCIAL_AUTH_PIPELINE = (
|
333 |
| - 'social_core.pipeline.social_auth.social_details', |
334 |
| - 'social_core.pipeline.social_auth.social_uid', |
335 |
| - 'social_core.pipeline.social_auth.auth_allowed', |
336 |
| - 'social_core.pipeline.social_auth.social_user', |
337 |
| - 'social_core.pipeline.user.get_username', |
338 |
| - 'social_core.pipeline.user.create_user', |
339 |
| - 'app.pipeline.save_profile', |
340 |
| - 'social_core.pipeline.social_auth.associate_user', |
341 |
| - 'social_core.pipeline.social_auth.load_extra_data', |
| 277 | + 'social_core.pipeline.social_auth.social_details', 'social_core.pipeline.social_auth.social_uid', |
| 278 | + 'social_core.pipeline.social_auth.auth_allowed', 'social_core.pipeline.social_auth.social_user', |
| 279 | + 'social_core.pipeline.user.get_username', 'social_core.pipeline.user.create_user', 'app.pipeline.save_profile', |
| 280 | + 'social_core.pipeline.social_auth.associate_user', 'social_core.pipeline.social_auth.load_extra_data', |
342 | 281 | 'social_core.pipeline.user.user_details',
|
343 | 282 | )
|
344 | 283 |
|
|
391 | 330 | env('GA_AUTH_PROVIDER_X509_CERT_URL', default='https://www.googleapis.com/oauth2/v1/certs'),
|
392 | 331 | 'client_x509_cert_url': env('GA_CLIENT_X509_CERT_URL', default='')
|
393 | 332 | }
|
394 |
| -HOTJAR_CONFIG = { |
395 |
| - 'hjid': env.int('HOTJAR_ID', default=0), |
396 |
| - 'hjsv': env.int('HOTJAR_SV', default=0), |
397 |
| -} |
| 333 | +HOTJAR_CONFIG = {'hjid': env.int('HOTJAR_ID', default=0), 'hjsv': env.int('HOTJAR_SV', default=0), } |
398 | 334 |
|
399 | 335 | # Rollbar - https://rollbar.com/docs/notifier/pyrollbar/#django
|
400 | 336 | ROLLBAR_CLIENT_TOKEN = env('ROLLBAR_CLIENT_TOKEN', default='') # post_client_item
|
|
411 | 347 | 'capture_ip': 'anonymize',
|
412 | 348 | 'capture_username': True,
|
413 | 349 | 'scrub_fields': [
|
414 |
| - 'pw', |
415 |
| - 'passwd', |
416 |
| - 'password', |
417 |
| - 'secret', |
418 |
| - 'confirm_password', |
419 |
| - 'confirmPassword', |
420 |
| - 'password_confirmation', |
421 |
| - 'passwordConfirmation', |
422 |
| - 'access_token', |
423 |
| - 'accessToken', |
424 |
| - 'auth', |
425 |
| - 'authentication', |
426 |
| - 'github_access_token', |
427 |
| - 'github_client_secret', |
428 |
| - 'secret_key', |
429 |
| - 'twitter_access_token', |
430 |
| - 'twitter_access_secret', |
431 |
| - 'twitter_consumer_secret', |
432 |
| - 'mixpanel_token', |
433 |
| - 'slack_verification_token', |
434 |
| - 'redirect_state', |
435 |
| - 'slack_token', |
| 350 | + 'pw', 'passwd', 'password', 'secret', 'confirm_password', 'confirmPassword', 'password_confirmation', |
| 351 | + 'passwordConfirmation', 'access_token', 'accessToken', 'auth', 'authentication', 'github_access_token', |
| 352 | + 'github_client_secret', 'secret_key', 'twitter_access_token', 'twitter_access_secret', |
| 353 | + 'twitter_consumer_secret', 'mixpanel_token', 'slack_verification_token', 'redirect_state', 'slack_token', |
436 | 354 | 'priv_key',
|
437 | 355 | ],
|
438 | 356 | }
|
|
448 | 366 | rollbar.init(**ROLLBAR)
|
449 | 367 |
|
450 | 368 | # List of github usernames to not count as comments on an issue
|
451 |
| -IGNORE_COMMENTS_FROM = [ |
452 |
| - 'gitcoinbot', |
453 |
| -] |
| 369 | +IGNORE_COMMENTS_FROM = ['gitcoinbot', ] |
454 | 370 |
|
455 | 371 | # optional: only needed if you run the activity-report management command
|
456 | 372 | AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID', default='')
|
|
0 commit comments