7. Running the Open edX Developer Stack

This section describes how to run the Open edX Developer Stack.

7.1. Connect to the Devstack Virtual Machine

  1. To connect to the Devstack virtual machine, use the SSH command from the devstack directory.

    vagrant ssh
    
  2. To use Devstack and perform any of the tasks described in this section, you must connect as the user edxapp.

    sudo su edxapp
    

    This command loads the edxapp environment from the file /edx/app/edxapp/edxapp_env. This puts venv python and rbenv ruby in your search path.

    This command also sets the current working directory to the edx-platform repository (/edx/app/edxapp/edx-platform).

7.2. Set Up Ability to Preview Units (Mac/Linux Only)

If you are installing Devstack on a Linux or Macintosh computer, in order to use the preview feature in edX Studio, you must add the following line to the etc/hosts file.

192.168.33.10 preview.localhost

7.3. Customize the Source Code Location

You can customize the location of the edX source code that gets cloned when you provision Devstack. You may want to do this to have Devstack work with source code that already exists on your computer.

By default, the source code location is the directory in which you run vagrant up. To change this location, set the VAGRANT_MOUNT_BASE environment variable to set the base directory for the edx-platform and cs_comments_service source code directories.

7.4. Run the LMS on Devstack

When you run the LMS on Devstack, the command updates requirements and compiles assets, unless you use the fast option.

The command uses the file lms/envs/devstack.py. This file overrides production settings for the LMS.

To run the LMS on Devstack, follow these steps.

  1. Connect to the Devstack Virtual Machine.

  2. Run the following command.

    paver devstack lms
    

    Or, to start the LMS without updating requirements and compiling assets, use the fast option.

    paver devstack lms --fast
    

    The LMS starts.

  3. Open the LMS in your browser at http://localhost:8000/.

    Vagrant forwards port 8000 to the LMS server running in the virtual machine.

7.5. Run Studio on Devstack

When you run Studio on Devstack, the command updates requirements and compiles assets, unless you use the fast option.

You run Studio on Devstack with the file cms/envs/devstack.py. This file overrides production settings for Studio.

To run Studio on Devstack, follow these steps.

  1. Connect to the Devstack Virtual Machine.

  2. Run the following command.

    paver devstack studio
    

    Or, to start Studio without updating requirements and compiling assets, use the fast option.

    paver devstack studio --fast
    

    Studio starts.

  3. Open Studio in your browser at http://localhost:8001/.

    Vagrant forwards port 8001 to the Studio server running in the virtual machine.

7.5.1. View Available Studio Commands

To view all available commands for Studio, enter the following command.

./manage.py cms -h --settings=devstack

7.6. Run Discussion Forums on Devstack

To run discussion forums on Devstack, follow these steps.

  1. Connect to the Devstack Virtual Machine.

  2. Switch to the discussion forum account by entering the following command.

    sudo su forum
    
  3. Update Ruby requirements.

    bundle install
    

    Note

    If you get a message for entering a password to install the bundled RubyGems to the system, you can safely exit by entering control+c on a Macintosh or Ctrl+C on Windows. The RubyGems will still be installed correctly for the forum user.

  4. Start the discussion forums server.

    ruby app.rb -p 18080
    

The discussions forum server starts. You can access the discussion forums API at http://localhost:18080/.

7.7. Default Accounts on Devstack

When you install Devstack, the following accounts are created.

Account Description
staff@example.com An LMS and Studio user with course creation and editing permissions. This user is a course team member with the Admin role, which gives rights to work with the demonstration course in Studio, the LMS, and Insights.
verified@example.com A student account that you can use to access the LMS for testing verified certificates.
audit@example.com A student account that you can use to access the LMS for testing course auditing.
honor@example.com A student account that you can use to access the LMS for testing honor code certificates.

The password for all of these accounts is edx.