Permalink
Browse files

added simple command to list all current settings

  • Loading branch information...
1 parent b4d6f87 commit e199d5c181e41f57979810392ada40f1076f5405 @WoLpH committed May 5, 2012
No changes.
@@ -0,0 +1,26 @@
+from django.core.management.base import BaseCommand
+import pprint
+
+class Command(BaseCommand):
+ help = '''Get a list of the current settings, any arguments given will be
+ used to match the settings name (case insensitive).
+ '''
+ can_import_settings = True
+ requires_model_validation = False
+
+ def handle(self, *args, **options):
+ from django.conf import settings
+ args = map(unicode.lower, args)
+ for k in dir(settings):
+ if k.lower() == k:
+ v = getattr(settings, k)
+ found = not bool(args)
+ for arg in args:
+ if arg in k:
+ found = True
+ break
+
+ if found:
+ print '%s: ' % k,
+ pprint.pprint(v)
+

0 comments on commit e199d5c

Please sign in to comment.