diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:22:27 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-25 18:22:27 +0200 |
commit | 29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897 (patch) | |
tree | f2a910cbea747a7b0c0a50d6c66691e54f5ef47f /core/module/web/createsuperuser.py | |
parent | merged gui (diff) | |
download | pyload-29f9dc8fb3396b03d732ebcbeb1cc8f00fe13897.tar.xz |
new dirs
Diffstat (limited to 'core/module/web/createsuperuser.py')
-rw-r--r-- | core/module/web/createsuperuser.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/core/module/web/createsuperuser.py b/core/module/web/createsuperuser.py deleted file mode 100644 index 0ff1d15b8..000000000 --- a/core/module/web/createsuperuser.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -Management utility to create superusers. -""" - -import os -import sys - -os.environ["DJANGO_SETTINGS_MODULE"] = 'settings' -sys.path.append(os.path.join(pypath, "module", "web")) - -import getpass -import re -from optparse import make_option -from django.contrib.auth.models import User -from django.core import exceptions -from django.core.management.base import BaseCommand, CommandError -from django.utils.translation import ugettext as _ - -RE_VALID_USERNAME = re.compile('[\w.@+-]+$') - - -def handle(username, email): - #username = options.get('username', None) - #email = options.get('email', None) - interactive = False - - # Do quick and dirty validation if --noinput - if not interactive: - if not username or not email: - raise CommandError("You must use --username and --email with --noinput.") - if not RE_VALID_USERNAME.match(username): - raise CommandError("Invalid username. Use only letters, digits, and underscores") - - password = '' - default_username = '' - - User.objects.create_superuser(username, email, password) - print "Superuser created successfully." - -if __name__ == "__main__": - username = sys.argv[1] - email = sys.argv[2] - handle(username, email)
\ No newline at end of file |