Settings¶
In order to start using django-latch in your Django project, you need
to set up some settings in your settings module.
Other settings are optional and their default value may be enough for your
needs, but it is also recommended reading what those are about.
Required settings¶
- django.conf.settings.LATCH_APP_ID¶
Identifier of the application in Latch. You need to register as a developer in the Latch portal to get this id and the
LATCH_SECRET_KEY.The value of this setting needs to be kept secret, so it is recommended using a secret manager or environment variables.
Optional settings¶
- django.conf.settings.LATCH_HTTP_BACKEND¶
A
strthat indicates the HTTP backend to use to interact with the Latch service. This is used by the latch_sdk_python, package.A default of
'http'is assumed when this setting is not supplied. This value implies that latch_sdk_python will use thehttp.client.HTTPConnectionandhttp.client.HTTPSConnectionfrom the standard library to manage the requests and responses to and from the Latch service. If the value supplied is'requests'or'httpx', the corresponding packages have to be installed. In case of the'requests'option, this can be done by running the command:python -m pip install django-latch[requests]
py -m pip install django-latch[requests]
Then, latch_sdk_python will use
requests.Session.or in case of the
'httpx'option:python -m pip install django-latch[httpx]
py -m pip install django-latch[httpx]
Then, latch_sdk_python will use httpx.Client.