Skip to content

Commit

Permalink
bf-fix-cors-bug-163115612
Browse files Browse the repository at this point in the history
- add django-cors package
- specify a whitelist for CORS requests

[starts #163115612]
  • Loading branch information
babbageLabs committed Jan 10, 2019
1 parent 0a731f4 commit fa84488
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions authors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD')
EMAIL_PORT = 587
EMAIL_USE_TLS = True
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand All @@ -129,8 +131,7 @@

DATABASES = {
# read the database environ
'default': dj_database_url.config(
default=env.db(), conn_max_age=1000)
'default': env.db()
}

# Password validation
Expand Down Expand Up @@ -169,9 +170,12 @@

STATIC_URL = '/static/'

CORS_ORIGIN_ALLOW_ALL = False

CORS_ORIGIN_WHITELIST = (
'0.0.0.0:4000',
'localhost:4000',
'localhost:3000',
)
# Tell Django about the custom `User` model we created. The string
# `authentication.User` tells Django we are referring to the `User` model in
Expand Down Expand Up @@ -217,6 +221,8 @@
}
},
}

LOG_LEVEL = 'DEBUG'
logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': False,
Expand Down

0 comments on commit fa84488

Please sign in to comment.