add CORS feature

This commit is contained in:
karmaking 2025-01-10 18:03:06 +01:00
parent 4aa032d7fa
commit 8e8091a0ea
2 changed files with 4 additions and 1 deletions

View File

@ -44,6 +44,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'bootstrap',
'bootstrap_datepicker_plus',
'mathfilters',
@ -86,6 +87,7 @@ MIDDLEWARE = [
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'django.middleware.cache.FetchFromCacheMiddleware',
'corsheaders.middleware.CorsMiddleware'
]
#cache the view page, we set 60s = 1m,

View File

@ -10,4 +10,5 @@ matplotlib
django-bootstrap-datepicker-plus
django-mathfilters
django-bootstrap
django-csp
django-csp
django-cors-headers