Skip to content

Commit

Permalink
fix: add CORS middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Sep 25, 2023
1 parent f01582b commit 71c3d1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apis_ontology/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'allow_cidr.middleware.AllowCIDRMiddleware',
'corsheaders.middleware.CorsMiddleware',
]

ROOT_URLCONF = 'apis_ontology.urls'
Expand Down Expand Up @@ -68,3 +69,7 @@
PROJECT_DEFAULT_MD = {}

ALLOWED_HOSTS = ["oebl-pnp.acdh-dev.oeaw.ac.at"]

CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_METHODS = ("GET", "OPTIONS")
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ python = "^3.11"
django = ">=4.1,<4.2"
django-allow-cidr = "^0.6.0"
psycopg2 = "^2.9"
django-cors-headers = "^4"
apis-core = { git = "https://github.com/acdh-oeaw/apis-core-rdf.git", tag = "v0.3.1" }
apis-acdhch-default-settings = { git = "https://github.com/acdh-oeaw/apis-acdhch-default-settings.git", tag = "v0.1.7" }

Expand Down

0 comments on commit 71c3d1f

Please sign in to comment.