Skip to content

Commit 33e4455

Browse files
committed
Add few very important comments
1 parent 15b17f2 commit 33e4455

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

config/django/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
]
5555

5656
INSTALLED_APPS = [
57-
# "django.contrib.admin",
58-
"styleguide_example.custom_admin.apps.CustomAdminConfig",
57+
"django.contrib.admin",
58+
# If you want to have required 2FA for the Django admin
59+
# Uncomment the line below and comment out the default admin
60+
# "styleguide_example.custom_admin.apps.CustomAdminConfig",
5961
"django.contrib.auth",
6062
"django.contrib.contenttypes",
6163
"django.contrib.sessions",

styleguide_example/blog_examples/admin.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
@admin.register(UserTwoFactorAuthData)
88
class UserTwoFactorAuthDataAdmin(admin.ModelAdmin):
9+
"""
10+
This admin is for example purposes and ease of development and debugging.
11+
Leaving this admin in production is a security risk.
12+
13+
Please refer to the following blog post for more information:
14+
https://hacksoft.io/blog/adding-required-two-factor-authentication-2fa-to-the-django-admin
15+
"""
16+
917
def qr_code(self, obj):
1018
return format_html(obj.generate_qr_code())
1119

0 commit comments

Comments
 (0)