master
Jerrica Bobadilla 5 years ago
parent 32d2050b41
commit d2d17f56a4

@ -14,6 +14,7 @@ dj-database-url = "*"
python-dotenv = "*" python-dotenv = "*"
gunicorn = "*" gunicorn = "*"
whitenoise = "*" whitenoise = "*"
django-cors-headers = "*"
[requires] [requires]
python_version = "3.8" python_version = "3.8"

10
Pipfile.lock generated

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "a25ca89be3f4cece40a21706dbfcbe4881c85256c7952735821d2ff0b3feac6f" "sha256": "cc2b2c810cbcf08a8b06bcbbf072d05f88e6c769541d4610cd23c8b0effb8565"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@ -40,6 +40,14 @@
"index": "pypi", "index": "pypi",
"version": "==3.1.2" "version": "==3.1.2"
}, },
"django-cors-headers": {
"hashes": [
"sha256:9322255c296d5f75089571f29e520c83ff9693df17aa3cf9f6a4bea7c6740169",
"sha256:db82b2840f667d47872ae3e4a4e0a0d72fbecb42779b8aa233fa8bb965f7836a"
],
"index": "pypi",
"version": "==3.5.0"
},
"django-extensions": { "django-extensions": {
"hashes": [ "hashes": [
"sha256:6809c89ca952f0e08d4e0766bc0101dfaf508d7649aced1180c091d737046ea7", "sha256:6809c89ca952f0e08d4e0766bc0101dfaf508d7649aced1180c091d737046ea7",

@ -42,11 +42,13 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django_extensions', 'django_extensions',
'corsheaders',
'rest_framework', 'rest_framework',
'contacts_api', 'contacts_api',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
@ -57,6 +59,10 @@ MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware',
] ]
# Configure cors to whitelist all origins
# https://github.com/adamchainz/django-cors-headers#cors_allow_all_origins
CORS_ALLOW_ALL_ORIGINS = True
# Simplified static file serving. # Simplified static file serving.
# https://warehouse.python.org/project/whitenoise/ # https://warehouse.python.org/project/whitenoise/
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

Loading…
Cancel
Save