summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2021-11-09 22:23:03 +0100
committerjdlugosz963 <jdlugosz963@gmail.com>2021-11-09 22:23:03 +0100
commit30da4738eee6c2436dd6f4d879069c0e3713eec6 (patch)
tree95ec7be5088201ba7c9b55142638a957e860ed1b
parent946c262908e657d09df5eb6a011d3d7cedb0fa65 (diff)
downloadlom_api-30da4738eee6c2436dd6f4d879069c0e3713eec6.tar.gz
lom_api-30da4738eee6c2436dd6f4d879069c0e3713eec6.zip
add cors
-rw-r--r--lom_api/settings.py7
-rw-r--r--python.req1
2 files changed, 6 insertions, 2 deletions
diff --git a/lom_api/settings.py b/lom_api/settings.py
index 7c85027..a09c7a7 100644
--- a/lom_api/settings.py
+++ b/lom_api/settings.py
@@ -26,6 +26,7 @@ SECRET_KEY = 'django-insecure-w699xg1453&j057k$g465vldjn+4*skp8!13ua=aq0s_91b@c)
26DEBUG = True 26DEBUG = True
27 27
28ALLOWED_HOSTS = ['*'] 28ALLOWED_HOSTS = ['*']
29CORS_ORIGIN_ALLOW_ALL = True
29 30
30 31
31# Application definition 32# Application definition
@@ -39,6 +40,7 @@ INSTALLED_APPS = [
39 'django.contrib.staticfiles', 40 'django.contrib.staticfiles',
40 'rest_framework', 41 'rest_framework',
41 'knox', 42 'knox',
43 'corsheaders',
42 'auth_api', 44 'auth_api',
43 'chat_api' 45 'chat_api'
44] 46]
@@ -48,9 +50,9 @@ REST_FRAMEWORK = {
48} 50}
49 51
50REST_KNOX = { 52REST_KNOX = {
51 'TOKEN_LIMIT_PER_USER': 1, 53# 'TOKEN_LIMIT_PER_USER': 1,
52} 54}
53 55
54MIDDLEWARE = [ 56MIDDLEWARE = [
55 'django.middleware.security.SecurityMiddleware', 57 'django.middleware.security.SecurityMiddleware',
56 'django.contrib.sessions.middleware.SessionMiddleware', 58 'django.contrib.sessions.middleware.SessionMiddleware',
@@ -59,6 +61,7 @@ MIDDLEWARE = [
59 'django.contrib.auth.middleware.AuthenticationMiddleware', 61 'django.contrib.auth.middleware.AuthenticationMiddleware',
60 'django.contrib.messages.middleware.MessageMiddleware', 62 'django.contrib.messages.middleware.MessageMiddleware',
61 'django.middleware.clickjacking.XFrameOptionsMiddleware', 63 'django.middleware.clickjacking.XFrameOptionsMiddleware',
64 'corsheaders.middleware.CorsMiddleware',
62] 65]
63 66
64ROOT_URLCONF = 'lom_api.urls' 67ROOT_URLCONF = 'lom_api.urls'
diff --git a/python.req b/python.req
index 9a4a7c2..4f2ded4 100644
--- a/python.req
+++ b/python.req
@@ -2,6 +2,7 @@ asgiref==3.4.1
2cffi==1.15.0 2cffi==1.15.0
3cryptography==35.0.0 3cryptography==35.0.0
4Django==3.2.9 4Django==3.2.9
5django-cors-headers==3.10.0
5django-rest-knox==4.1.0 6django-rest-knox==4.1.0
6djangorestframework==3.12.4 7djangorestframework==3.12.4
7pycparser==2.21 8pycparser==2.21