diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-02 21:46:15 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-02 21:46:15 +0100 |
commit | 7a503302fbe6fcc23af94de2fe313298c3a6d95c (patch) | |
tree | 724a8581008d3d78fed0be965161e330eb4b1064 /module/web/createsuperuser.py | |
parent | closes #226, #227 (diff) | |
download | pyload-7a503302fbe6fcc23af94de2fe313298c3a6d95c.tar.xz |
removed django => now using bottle, new builtin threaded ssl server
Dont forget to install jinja and beaker !
Diffstat (limited to 'module/web/createsuperuser.py')
-rw-r--r-- | module/web/createsuperuser.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/module/web/createsuperuser.py b/module/web/createsuperuser.py deleted file mode 100644 index 0ff1d15b8..000000000 --- a/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 |