<commit_before># Local
from .base import *

# AWS S3  Settings
# `Static` means public-read, static resources like CSS, Images, etc.
# `Media` means user or admin-uploaded resources

# Configure AWS variables
AWS_ACCESS_KEY_ID = get_env_variable("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = get_env_variable("AWS_SECRET_ACCESS_KEY")
AWS_PRELOAD_METADATA = True
AWS_REGION = "us-west-1"
AWS_S3_KEY_PREFIX = "files/"
AWS_S3_KEY_PREFIX_STATIC = "static/"
AWS_S3_BUCKET_AUTH = False
AWS_S3_BUCKET_NAME = "{0}".format(PROJECT_NAME)
AWS_S3_BUCKET_NAME_STATIC = "{0}".format(PROJECT_NAME)
AWS_S3_MAX_AGE_SECONDS_STATIC = 60 * 60  # 1 hour

# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Static Server Config
STATIC_STORAGE = 'django_s3_storage.storage.StaticS3Storage'
# STATIC_URL = 'https://{0}.s3-us-west-1.amazonaws.com/'.format(
#     AWS_STATIC_BUCKET_NAME,
# )

# Media (File Upload) Server Config
AWS_MEDIA_BUCKET_NAME = "{0}".format(PROJECT_NAME)
MEDIA_STORAGE = 'django_s3_storage.storage.S3Storage'
# MEDIA_URL = 'https://{0}.s3-us-west-1.amazonaws.com/'.format(
#     AWS_MEDIA_BUCKET_NAME,
# )

# Aliasing Django Defaults
DEFAULT_FILE_STORAGE = MEDIA_STORAGE
STATICFILES_STORAGE = STATIC_STORAGE

# CORS Settings
CORS_ORIGIN_WHITELIST = (
    'barberscore-ember.herokuapp.com',
    'barberscore.com',
    'barberscore.s3.amazonaws.com',
)

# Email
DEFAULT_FROM_EMAIL = '<EMAIL>'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = get_env_variable("SENDGRID_USERNAME")
EMAIL_HOST_PASSWORD = get_env_variable("SENDGRID_PASSWORD")<commit_msg>Add prefix to CORS whitelist<commit_after># Local
from .base import *

# AWS S3  Settings
# `Static` means public-read, static resources like CSS, Images, etc.
# `Media` means user or admin-uploaded resources

# Configure AWS variables
AWS_ACCESS_KEY_ID = get_env_variable("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = get_env_variable("AWS_SECRET_ACCESS_KEY")
AWS_PRELOAD_METADATA = True
AWS_REGION = "us-west-1"
AWS_S3_KEY_PREFIX = "files/"
AWS_S3_KEY_PREFIX_STATIC = "static/"
AWS_S3_BUCKET_AUTH = False
AWS_S3_BUCKET_NAME = "{0}".format(PROJECT_NAME)
AWS_S3_BUCKET_NAME_STATIC = "{0}".format(PROJECT_NAME)
AWS_S3_MAX_AGE_SECONDS_STATIC = 60 * 60  # 1 hour

# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Static Server Config
STATIC_STORAGE = 'django_s3_storage.storage.StaticS3Storage'
# STATIC_URL = 'https://{0}.s3-us-west-1.amazonaws.com/'.format(
#     AWS_STATIC_BUCKET_NAME,
# )

# Media (File Upload) Server Config
AWS_MEDIA_BUCKET_NAME = "{0}".format(PROJECT_NAME)
MEDIA_STORAGE = 'django_s3_storage.storage.S3Storage'
# MEDIA_URL = 'https://{0}.s3-us-west-1.amazonaws.com/'.format(
#     AWS_MEDIA_BUCKET_NAME,
# )

# Aliasing Django Defaults
DEFAULT_FILE_STORAGE = MEDIA_STORAGE
STATICFILES_STORAGE = STATIC_STORAGE

# CORS Settings
CORS_ORIGIN_WHITELIST = (
    'barberscore-ember.herokuapp.com',
    'barberscore.com',
    'www.barberscore.com',
    'barberscore.s3.amazonaws.com',
)

# Email
DEFAULT_FROM_EMAIL = '<EMAIL>'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = get_env_variable("SENDGRID_USERNAME")
EMAIL_HOST_PASSWORD = get_env_variable("SENDGRID_PASSWORD")
{'fraction_non_alphanumeric': 0.11732007021650087, 'fraction_numerical': 0.01579871269748391, 'mean_word_length': 6.24364406779661, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2098832', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1389, 'n_words': 208}