Code

Ticket #17037: django_manage_py_printsettings.diff

File django_manage_py_printsettings.diff, 676 bytes (added by msabramo, 3 years ago)

Patch to add printsettings management command

Line 
1Index: django/core/management/commands/printsettings.py
2===================================================================
3--- django/core/management/commands/printsettings.py    (revision 0)
4+++ django/core/management/commands/printsettings.py    (revision 0)
5@@ -0,0 +1,14 @@
6+from django.core.management.base import BaseCommand
7+from django.conf import settings
8+
9+
10+class Command(BaseCommand):
11+    help = "Print the active Django settings"
12+
13+    def handle(self, *args, **options):
14+        for key in dir(settings):
15+            if key.startswith('__'):
16+                continue
17+
18+            value = getattr(settings, key)
19+            print('%-40s : %s' % (key, value))