Skip to content

Commit

Permalink
Merge pull request #8 from weni-ai/feature/cors-origins
Browse files Browse the repository at this point in the history
Configure CORS
  • Loading branch information
Sandro-Meireles authored May 21, 2024
2 parents c78e964 + 0cdd741 commit 12c70d9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions apip/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"apip.testplans",
"apip.testcases",
"django_ace",
"corsheaders",
]

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
Expand Down Expand Up @@ -145,3 +147,9 @@
# Mock settings

FAKER_CLASS = "application.fackers.CLIJSFFaker"


# django-cors-headers Configurations

CORS_ALLOWED_ORIGINS = env.list("CORS_ALLOWED_ORIGINS", default="")
CORS_ALLOW_ALL_ORIGINS = env.str("CORS_ALLOW_ALL_ORIGINS", default=DEBUG)
17 changes: 16 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ django-environ = "^0.11.2"
requests = "^2.31.0"
django-ace = "^1.32.4"
psycopg2 = "^2.9.9"
django-cors-headers = "^4.3.1"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 12c70d9

Please sign in to comment.