Created
January 14, 2014 18:45
-
-
Save antoviaque/8423488 to your computer and use it in GitHub Desktop.
Granting superuser privileges to an existing user in edX
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
edxapp@edx:~/edx-platform$ ./manage.py lms shell --settings=devstack | |
Python 2.7.3 (default, Sep 26 2013, 20:03:06) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 0.13.1 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. | |
In [1]: from django.contrib.auth.models import User | |
In [3]: u=User.objects.get(email='[email protected]') | |
In [4]: u.__dict__ | |
Out[4]: | |
{'_state': <django.db.models.base.ModelState at 0x6020350>, | |
'date_joined': datetime.datetime(2014, 1, 14, 18, 43, 16, 650913, tzinfo=<UTC>), | |
'email': u'[email protected]', | |
'first_name': u'', | |
'id': 1, | |
'is_active': True, | |
'is_staff': False, | |
'is_superuser': False, | |
'last_login': datetime.datetime(2014, 1, 14, 18, 43, 17, 312285, tzinfo=<UTC>), | |
'last_name': u'', | |
'password': u'pbkdf2_sha256$10000$HvmM30qsT3qF$0QHrCnvVQt4fHHBVcF39UG5nSoI+dM6s2V87cRCNHZM=', | |
'username': u'XavierAntoviaque'} | |
In [5]: u.is_staff = True | |
In [6]: u.is_superuser=True | |
In [7]: u.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment