Skip to content

Commit 09dab0d

Browse files
authored
disable unused django apps and middlewares (the-benchmarker#7391)
1 parent e8ba392 commit 09dab0d

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

python/django/app/views.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from django.http import HttpResponse
2-
from django.views.decorators.csrf import csrf_exempt
32

43

54
def index(request):
@@ -10,6 +9,5 @@ def get_user(request, id):
109
return HttpResponse(id)
1110

1211

13-
@csrf_exempt
1412
def create_user(request):
1513
return HttpResponse(status=200)

python/django/settings.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,9 @@
1616

1717
# Application definition
1818

19-
INSTALLED_APPS = [
20-
"django.contrib.admin",
21-
"django.contrib.auth",
22-
"django.contrib.contenttypes",
23-
"django.contrib.sessions",
24-
"django.contrib.messages",
25-
"django.contrib.staticfiles",
26-
]
19+
INSTALLED_APPS = []
2720

28-
MIDDLEWARE = [
29-
"django.middleware.security.SecurityMiddleware",
30-
"django.contrib.sessions.middleware.SessionMiddleware",
31-
"django.middleware.common.CommonMiddleware",
32-
"django.middleware.csrf.CsrfViewMiddleware",
33-
"django.contrib.auth.middleware.AuthenticationMiddleware",
34-
"django.contrib.messages.middleware.MessageMiddleware",
35-
"django.middleware.clickjacking.XFrameOptionsMiddleware",
36-
]
21+
MIDDLEWARE = []
3722

3823
ROOT_URLCONF = "app.urls"
3924

0 commit comments

Comments
 (0)