I want to set an if condition in settings.py in my django app, to check the url and apply correct GOOGLE_RECAPTCHA_SECRET_KEY for the site. because of difference in local host and web server domin.
I used requests._current_scheme_host
but get an error:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/apps/registry.py", line 136, in check_apps_ready raise AppRegistryNotReady("Apps aren't loaded yet.") django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.