1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

magic-removal: Fixed #1405 -- 'createsuperuser' no longer assumes 'import pwd' will work. Thanks, anonymous

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-03-01 03:26:08 +00:00
parent e8cfcf28e6
commit b2dd439085

View File

@ -660,8 +660,13 @@ def createsuperuser(username=None, email=None, password=None):
"Creates a superuser account."
from django.core import validators
from django.contrib.auth.models import User
import getpass, pwd
import getpass
try:
import pwd
except ImportError:
default_username = ''
else:
# Determine the current system user's username, to use as a default.
default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower()