summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-05-05 03:08:29 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-05-05 03:08:29 +0000
commitf94f0555bcf98e8b05874dfa3c804393ff4b91f4 (patch)
treeef2ef5c192e709233f6d580ddf628657f15bee2b /django
parentf2ef28fd5cd092b43f6dd33e127c20e66ea74fb8 (diff)
Fixed #1726 -- Made django/contrib/auth/create_superuser.py a command-line function, and added docs
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/create_superuser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/contrib/auth/create_superuser.py b/django/contrib/auth/create_superuser.py
index ab5ca36f50..f42d30539e 100644
--- a/django/contrib/auth/create_superuser.py
+++ b/django/contrib/auth/create_superuser.py
@@ -1,5 +1,8 @@
"""
Helper function for creating superusers in the authentication system.
+
+If run from the command line, this module lets you create a superuser
+interactively.
"""
from django.core import validators
@@ -82,3 +85,6 @@ def createsuperuser(username=None, email=None, password=None):
u.is_superuser = True
u.save()
print "Superuser created successfully."
+
+if __name__ == "__main__":
+ createsuperuser()