Last active
August 29, 2015 14:25
-
-
Save Nickersoft/9ab1761a06bdf7eb83f5 to your computer and use it in GitHub Desktop.
edx/ecommerce: Creating a new superuser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./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