-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Turnstile URLs to settings. Moved context processor and removed…
… redundant processor
- Loading branch information
1 parent
a4bb978
commit 6ce1168
Showing
4 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.conf import settings | ||
|
||
|
||
def turnstile_default_settings(request): | ||
""" | ||
Expose turnstile default settings to the default template context | ||
- Cloudflare Turnstile | ||
""" | ||
|
||
return { | ||
"TURNSTILE_JS_API_URL": getattr( | ||
settings, | ||
"TURN_JS_API_URL", | ||
"https://challenges.cloudflare.com/turnstile/v0/api.js", | ||
), | ||
"TURNSTILE_VERIFY_URL": getattr( | ||
settings, | ||
"TURNSTILE_VERIFY_URL", | ||
"https://challenges.cloudflare.com/turnstile/v0/siteverify", | ||
), | ||
"TURNSTILE_SITEKEY": getattr( | ||
settings, "TURNSTILE_SITEKEY", "1x00000000000000000000BB" | ||
), | ||
"TURNSTILE_SECRET": getattr( | ||
settings, "TURNSTILE_SECRET", "1x0000000000000000000000000000000AA" | ||
), | ||
"TURNSTILE_TIMEOUT": getattr(settings, "TURNSTILE_TIMEOUT", 5), | ||
"TURNSTILE_DEFAULT_CONFIG": getattr(settings, "TURNSTILE_DEFAULT_CONFIG", {}), | ||
"TURNSTILE_PROXIES": getattr(settings, "TURNSTILE_PROXIES", {}), | ||
} |