Setting up Horizon with PyCharm

Email: jonas.pfannschmidt at
Date: 19/05/2015


The following is a short description on how to setup OpenStack Horizon in PyCharm. Unfortunately Django, the web-framework used by Horizon, is only supported in PyCharm Professional - The community edition is not sufficient.

A prerequisite is a running OpenStack installation. Horizon needs at least Keystone to communiacte to, although other services are needed as well to do anything useful. My recommendation is to use a devstack installation in a virtual machine. The development Horizon will still run on the local machine but it will point the Keystone within the devstack VM.

Development environment - Step by step

  1. Clone the horizon repository: git clone
  2. From the cloned directory, run: ./ This will create a virtual environment and run all tests against that environment.
  3. Create the file from the example provided by Horizon: cp openstack_dashboard/local/ openstack_dashboard/local/
  4. Open the file openstack_dashboard/local/ and search for OPENSTACK_HOST. Change this variable to point to your local devstack installation.
  5. Start PyCharm
  6. Click Create New Project
  7. Cick Django
  8. Point Location at your checked out horizon repository
  9. Click the gear-wheel icon next to Interpreter → Add Local and point to the interpreter in the virtual environment (Should be at: horizon/.venv/bin/python)
  10. Click File → Settings → Languages & Frameworks → Django and fill out the fields as in the screenshot below.
  11. Run Horizon by clicking on the Run icon or the Debug icon at the top right corner.
  12. Horizon should now be aviable under http://localhost:8001

Enable debug logging to the console

By default Horizon logs all messages with INFO level or higher to the console. For development purposes it makes sense to change this to DEBUG. This can be changed in the file openstack_dashboard/local/ In this file, search for LOGGING and change the console handler to DEBUG.

    'version': 1,
    # When set to True this will disable all logging except
    # for loggers specified in this configuration dictionary. Note that
    # if nothing is specified here and disable_existing_loggers is True,
    # django.db.backends will still log unless it is disabled explicitly.
    'disable_existing_loggers': False,
    'handlers': {
        'null': {
            'level': 'DEBUG',
            'class': 'django.utils.log.NullHandler',
        'console': {
            # Set the level to "DEBUG" for verbose output logging.
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',