Below is a working solution:

  1. Add your vm hostname and '127.0.0.1' to ALLOWED_HOSTS in settings.py

    ALLOWED_HOSTS = ['vcm-xxxxx.vm.duke.edu','127.0.0.1']

  2. Start your server by

    python3 manage.py runserver 0:8000

    Using 0.0.0.0 means the server runs on "all" interfaces on the machine, including the one which has a public IP.

  3. Open http://vcm-xxxxx.vm.duke.edu:8000/ in browser and it should work