Re: How to create superuser?

1,255 views
Skip to first unread message

Skip Montanaro

unread,
Jan 7, 2013, 9:50:22 PM1/7/13
to django...@googlegroups.com
get_system_username
    return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None

I'm on a Mac, which has minimally broken locale support.  I went back to settings.py and set USE_L10N to False.  After that, the syncdb command worked, but I don't have a superuser.

Actually, the USE_L10N was a red herring.  I thought that because subsequent syncdb commands succeeded that this change fixed the problem.  I discovered the createsuperuser command.  That still fails with the decode() error.

Skip 

Carlos Daniel Ruvalcaba Valenzuela

unread,
Jan 7, 2013, 9:51:45 PM1/7/13
to django...@googlegroups.com
Check the docs, there is a manage.py command to create superusers once
the DB is sync'd:

https://docs.djangoproject.com/en/1.4/ref/django-admin/#createsuperuser

Regards,
Carlos Ruvalcaba
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iDGOBYozviYJ.
>
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Skip Montanaro

unread,
Jan 7, 2013, 10:04:52 PM1/7/13
to django...@googlegroups.com
Google to the rescue:


After setting LC_ALL in venv/bin/activate and re-sourcing solved my problem.  Not sure if this should be handled automatically by either Django or virtualenv setup, but maybe a note in the tutorial would be helpful for other clueless newbies like me.

Skip

Pedro J. Aramburu

unread,
Jan 7, 2013, 10:51:59 PM1/7/13
to django...@googlegroups.com
If you're using bash, you should set it up on ~/.bashrc file, that way it will always load, for every virtualenv and every terminal session.

BTW ~/ stands for the home directory and instead of LC_ALL try something like this:

export LANG="en_US.UTF-8"

That would give less trouble with other programs.
Reply all
Reply to author
Forward
0 new messages