Skip to content

Commit

Permalink
feat: Add Django Cors Headers (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
rehan892 authored Jul 8, 2024
1 parent b422961 commit 641d5dc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
{%- if cookiecutter.use_graphql == "y" %}
"strawberry_django",
{%- endif %}
]
{%- if cookiecutter.use_graphql == "y" or cookiecutter.use_drf == "y" %}
"corsheaders",
{%- endif %}
]

LOCAL_APPS = [
"{{ cookiecutter.project_slug }}.users.apps.UsersConfig",
Expand Down Expand Up @@ -350,6 +350,11 @@
"MUTATIONS_DEFAULT_HANDLE_ERRORS": True,
}
{%- endif %}
{%- if cookiecutter.use_graphql == "y" or cookiecutter.use_drf == "y" %}
# ------------------------------------------------------------------------------
# CORS settings
CORS_ALLOW_ALL_ORIGINS = True
{%- endif %}

# Your stuff...
# ------------------------------------------------------------------------------

0 comments on commit 641d5dc

Please # to comment.