Permalink
Browse files

added in Colin Grady's createsuperuser command and added an authors f…

…ile. Cleaned up the generate_secret_key
  • Loading branch information...
1 parent d247dbe commit 6a509f848c3004b7a54f18c2f10ed258e584498b @empty empty committed Dec 27, 2007
View
@@ -1,4 +1,4 @@
-Copyright (c) 2007 Eminent Consulting Group, LLC
+Copyright (c) 2007 Michael Trier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -0,0 +1,5 @@
+The following individuals have contributed to this project
+
+Ludvig Ericson (aka Toxic)
+Colin Grady (aka Magus)
+Michael Trier (aka Empty)
@@ -0,0 +1,18 @@
+from django.core.management.base import NoArgsCommand
+from optparse import make_option
+from django.contrib.auth.create_superuser import createsuperuser
+
+class Command(NoArgsCommand):
+ option_list = NoArgsCommand.option_list + (
+ make_option('--username', dest='username', default=None,
+ help='Specifies the username for the superuser.'),
+ make_option('--email', dest='email', default=None,
+ help='Specifies the email address for the superuser.'),
+ )
+ help = 'Used to create a superuser.'
+
+ def handle_noargs(self, **options):
+ username = options.get('username', None)
+ email = options.get('email', None)
+
+ createsuperuser(username=username, password=None, email=email)
@@ -5,7 +5,6 @@ class Command(NoArgsCommand):
help = "Generates a new SECRET_KEY that can be used in a project settings file."
requires_model_validation = False
- can_import_settings = True
def handle_noargs(self, **options):
return ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])

0 comments on commit 6a509f8

Please sign in to comment.