Skip to content

Commit

Permalink
Docs: Django integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsof committed Aug 7, 2023
1 parent e38e50e commit e1159ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/django.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Django integration
==================

If you are using the SDK in a `Django`_ project, you can add ``kabelwerk`` to
your ``INSTALLED_APPS`` — and the relevant ``KABELWERK_*`` variables in your
Django settings will be picked up by the SDK.

.. code:: python
# add 'kabelwerk' to your INSTALLED_APPS
INSTALLED_APPS = [
# ...
'kabelwerk',
]
# configure the Kabelwerk SDK
KABELWERK_URL = 'example.kabelwerk.io'
KABELWERK_API_TOKEN = '<secret>'
This way you can keep the Kabelwerk SDK config together with the rest of your
settings.


.. _`Django`: https://www.djangoproject.com/
.. _`INSTALLED_APPS`: https://docs.djangoproject.com/en/4.2/ref/settings/#installed-apps
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ You can set this in the SDK's config at runtime:
Alternatively, you can set the environment variables ``KABELWERK_URL`` and
``KABELWERK_API_TOKEN`` — these will be read when you first import the SDK.

If you have a Django project, you can also configure the SDK in your settings.
Check the `Django integration`_ page for more details.


Reference
---------
Expand All @@ -51,8 +54,10 @@ Reference

api
exceptions
django


.. _`Kabelwerk`: https://kabelwerk.io
.. _`Cheese Shop`: https://pypi.org/project/kabelwerk/
.. _`CHANGELOG.rst`: https://github.com/kabelwerk/sdk-python/blob/master/CHANGELOG.rst
.. _`Django integration`: django.html

0 comments on commit e1159ff

Please sign in to comment.