Skip to content

Commit 5641ca4

Browse files
authored
Add manual Django instructions
1 parent 628bf28 commit 5641ca4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

INSTALLATION.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@ To enable the Flask instrumentation, set the following environment variable in y
3030

3131
`export AUTOWRAPT_BOOTSTRAP=flask`
3232

33+
# Django (Manual)
34+
35+
When you set the the `AUTOWRAPT_BOOTSTRAP` environment, the Django framework should be automatically detected and instrumented. If for some reason, you prefer or need to manually instrument Django instead you can add add `instana.instrumentation.django.middleware.InstanaMiddleware` to you MIDDLEWARE list `settings.py`:
36+
37+
```Python
38+
import os
39+
import instana
40+
41+
# ... <snip> ...
42+
43+
MIDDLEWARE = [
44+
'instana.instrumentation.django.middleware.InstanaMiddleware',
45+
'django.middleware.security.SecurityMiddleware',
46+
'django.contrib.sessions.middleware.SessionMiddleware',
47+
'django.middleware.common.CommonMiddleware',
48+
'django.middleware.csrf.CsrfViewMiddleware',
49+
'django.contrib.auth.middleware.AuthenticationMiddleware',
50+
'django.contrib.messages.middleware.MessageMiddleware',
51+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
52+
]
53+
```
54+
3355
# WSGI Stacks
3456

3557
The Instana sensor includes WSGI middleware that can be added to any WSGI compliant stack. This is automated for various stacks but can also be done manually for those we haven't added support for yet.

0 commit comments

Comments
 (0)