Skip to content

Easy microsite management

Tomasz Zieliński edited this page Apr 8, 2015 · 2 revisions

In order to test microsites locally you need to set up the devstack, with some customizations:

  1. In Vagrantfile add the following snippet inside the Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|..end block:

      config.dns.tld = "dev"
      config.dns.patterns = [/^.*devstack.dev$/]
    
  2. Install vagrant-dns: vagrant plugin install vagrant-dns

  3. Only then create & provision the VM:

      OPENEDX_RELEASE="named-release/birch" vagrant up
    
  4. Make sure the domain resolves to the VM's IP:

      dig @127.0.0.1 -p 5300 devstack.dev
    
  5. SSH into the devstack: vagrant ssh

  6. Create /edx/app/edx_ansible/server-vars.yml and add the following lines to it:

      EDXAPP_SESSION_COOKIE_DOMAIN: ".devstack.dev"
      edx_platform_repo: "https://github.com/appsembler/edx-platform.git"
      edx_platform_version: "feature/easy-microsite-management"
    
  7. Update the installation:

      /edx/bin/update edx-platform feature/easy-microsite-management
    
  8. Turn user staff into Django superuser:

      sudo su edxapp
      cd /edx/app/edxapp/edx-platform
      python manage.py lms --settings=devstack shell
      from django.contrib.auth.models import User
      me = User.objects.get(username="staff")
      me.is_superuser = True
      me.is_staff = True
      me.save()
    
  9. Migrate the DB, just in case:

      python manage.py cms syncdb --migrate --settings devstack
    
  10. Run paver devstack [--fast] studio, then, on the host, visit http://devstack.dev:8001/admin, log in as "staff" (password: "edx") and create some microsites

  11. Run paver devstack [--fast] lms, the microsites should be working now: http://site1.devstack.dev:8000/, http://site2.devstack.dev:8000/

Clone this wiki locally