Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

How to view/update the Django admin console.

Step-by-step guide

To create a superuser for the lms application in Django:

  1. You'll do this by using the interactive python shell and modifying your user account.  First, create a new account in your local lms instance for your username at http://localhost:8000/register


  2. It is important to create the account using the registration page as opposed to the manage.py command line interface, as in addition to creating a user instance, it will create a profile instance, which some portions of the UI/backend require.

  3. Next, we'll need to drop down to an interactive python shell and issue some commands to modify the user.  First, let's log in to your vagrant instance:

    $ vagrant ssh
  4. Switch to the edxapp user:

    $ sudo su edxapp
  5. Start the interactive shell:

    $ ./manage.py lms --settings aws shell
  6. Once in the Shell, execute the following code, replacing your-user with your new user account, created above:

    from django.contrib.auth.models import User
    me = User.objects.get(username="your-user")
    me.is_superuser = True
    me.is_staff = True
    me.is_active = True # Alternatively, you could follow the activation link in the console output (what would have been sent by email if this wasn't a dev instance)
    me.save()
    exit()
  7. Confirm that you have access to the admin portal by logging in with your new account to LMS Admin

  • No labels