K
K
KhD2018-11-18 21:06:23
JSON Web Token
KhD, 2018-11-18 21:06:23

What middleware in Django (DRF + JWT) can be disabled?

I use Django 1.11.x + DRF 3.7.x + in the project

djangorestframework-jwt
https://getblimp.github.io/django-rest-framework-jwt/
.
The question is: can I disable such middleware in my project (painlessly):
  • django.middleware.common.CommonMiddleware
  • django.contrib.sessions.middleware.SessionMiddleware
  • django.contrib.messages.middleware.MessageMiddleware

If you have more advice, I'll be glad.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ivlev, 2018-11-20
@ivlevdenis_ru

Without SessionMiddleware, you won't be able to log into the admin area.
Without CommonMiddleware, Content-Length will not be set.
MessageMiddleware can be disabled, but there will be no messages in the admin panel, which is not critical.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question