From 40a660e9b6b1cf18a5db51014aac49efd9b88f08 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Wed, 9 May 2012 17:17:18 -0700 Subject: [PATCH] Add a set_key django admin command to make it easier to load keys --- core/management/commands/set_key.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/management/commands/set_key.py diff --git a/core/management/commands/set_key.py b/core/management/commands/set_key.py new file mode 100644 index 00000000..e90140ec --- /dev/null +++ b/core/management/commands/set_key.py @@ -0,0 +1,11 @@ +from django.core.management.base import BaseCommand +from regluit.core.models import Key + +class Command(BaseCommand): + help = "set a core.models.Key with name value" + args = " " + + def handle(self, name, value, **options): + k = Key.objects.create(name=name, value=value) + k.save() +