Skip to content

Commit 4465fc2

Browse files
authored
Disable Django admin by default (#198)
The Django admin panel feature has been commented out, to improve security, and to reduce the number of static files that have to be processed during collectstatic. (Given that many people won't use the feature, and it requires additional user setup before it can be used anyway.)
1 parent c0f6198 commit 4465fc2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

gettingstarted/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
# Application definition
4545

4646
INSTALLED_APPS = [
47-
"django.contrib.admin",
47+
# Uncomment this and the entry in `urls.py` if you wish to use the Django admin feature:
48+
# https://docs.djangoproject.com/en/4.2/ref/contrib/admin/
49+
# "django.contrib.admin",
4850
"django.contrib.auth",
4951
"django.contrib.contenttypes",
5052
"django.contrib.sessions",

gettingstarted/urls.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
1. Import the include() function: from django.urls import include, path
1515
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1616
"""
17-
from django.contrib import admin
17+
# from django.contrib import admin
1818
from django.urls import path
1919

2020
import hello.views
2121

2222
urlpatterns = [
2323
path("", hello.views.index, name="index"),
2424
path("db/", hello.views.db, name="db"),
25-
path("admin/", admin.site.urls),
25+
# Uncomment this and the entry in `INSTALLED_APPS` if you wish to use the Django admin feature:
26+
# https://docs.djangoproject.com/en/4.2/ref/contrib/admin/
27+
# path("admin/", admin.site.urls),
2628
]

0 commit comments

Comments
 (0)