adding cors helper for static asset

pull/3/head
lalanza808 5 years ago
parent add523a145
commit f8e9fd0d62

@ -1,6 +1,7 @@
Django==2.2.8
boto3==1.10.45
Pillow==6.2.1
django-cors-headers==3.2.0
django-redis==4.11.0
django-registration==3.0.1
django-storages==1.8.0

@ -40,10 +40,12 @@ INSTALLED_APPS = [
'items.apps.ItemsConfig',
'sales.apps.SalesConfig',
'core.apps.CoreConfig',
'huey.contrib.djhuey'
'huey.contrib.djhuey',
'corsheaders'
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
@ -219,3 +221,12 @@ WALLET_PASS = os.environ.get('WALLET_PASS', '')
EMAIL_BACKEND = os.environ.get('EMAIL_BACKEND', 'django.core.mail.backends.console.EmailBackend')
EMAIL_FROM = 'noreply@xmrauctions.net'
# CORS
CORS_ORIGIN_ALLOW_ALL = os.environ.get('CORS_ORIGIN_ALLOW_ALL', False)
CORS_ORIGIN_WHITELIST = os.environ.get('CORS_ORIGIN_WHITELIST', [])
CORS_ORIGIN_REGEX_WHITELIST = [
r"^https://static\.\w+\.xmrauctions\.com$",
]