Skip to content

Update and add settings #2624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

WoosterInitiative
Copy link
Contributor

I've been fighting with CORS and CSRF (amongst other things) while trying to get an API call with ajax to work. As such, I found that CORS_ORIGIN_ALLOW_ALL was fixed as True. I feel that it should be configurable by the user, so I added an os.getenv call for it with a default to True for no breaking changes. I also updated it per https://github.com/adamchainz/django-cors-headers to CORS_ALLOW_ALL_ORIGINS.

I added that and CSRF_TRUSTED_ORIGINS to the template .env file for better discoverability, though they're both commented out.

I didn't do a discussion on this first, but I can start one if that would be preferred.

Add deprecation notice for `CORS_ORIGIN_ALLOW_ALL` and auto switch to `CORS_ALLOW_ALL_ORIGINS`
Add option for CSRF_TRUSTED_ORIGINS for better discoverability.

Add options for newly added CORS_ALLOW_ALL_ORIGINS for discoverability as well as flexibility.
@vabene1111
Copy link
Collaborator

Thanks, no worries about a discussion, this does not add any more complexity so it's fine. Will review it and likely get it merged.

Thanks for the pr

@vabene1111 vabene1111 merged commit fe4bd6a into TandoorRecipes:develop Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants