Skip to content

Instantly share code, notes, and snippets.

@Nickersoft
Last active August 29, 2015 14:25
Show Gist options
  • Save Nickersoft/9ab1761a06bdf7eb83f5 to your computer and use it in GitHub Desktop.
Save Nickersoft/9ab1761a06bdf7eb83f5 to your computer and use it in GitHub Desktop.
edx/ecommerce: Creating a new superuser
$ ./manage.py shell
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth import get_user_model
>>> User = get_user_model()
>>> user = User.objects.create_user('username', '[email protected]', 'password')
>>> user.is_staff = True
>>> user.is_superuser = True
>>> user.save()
>>> exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment