Troubleshooting And Debugging¶
Mistral-Dashboard debug instructions¶
Pycharm
Debugging OpenStack Mistral-Dashboard is the same as debugging OpenStack Horizon. The following instructions should get you sorted to debug both on the same run.
Set PyCharm debug settings:
- Under File > Settings > Languages and Framework > Django - Enter the following:
- Check “Enable Django Support”
- Django project root: your file system path to Horizon project root
- Settings: openstack_dashboard/settings.py (under your Horizon folder)
- Manage script: manage.py (also in your horizon folder)
- Click OK
![../_images/Mistral_dashboard_django_settings.png](../_images/Mistral_dashboard_django_settings.png)
- Enter debug configurations menu, using the tiny arrow pointing down, left to the “play” icon, or under the run menu
![../_images/Pycharm_run_config_menu.png](../_images/Pycharm_run_config_menu.png)
- In the new window, click the green plus icon and then select “Django server” to create a new Django Server configuration.
- In the new window appeared:
- Name that configuration Horizon
- Enter some port so it won’t run on the default (for example - port: 4000)
![../_images/Mistral_dashboard_debug_config.png](../_images/Mistral_dashboard_debug_config.png)
- Click on Environment variables button, then in the new window:
- Make sure you have PYTHONUNBUFFERED set as 1
- Create a new pair - DJANGO_SETTINGS_MODULE : openstack_dashboard.settings
- When finished click OK.
![../_images/Mistral_dashboard_environment_variables.png](../_images/Mistral_dashboard_environment_variables.png)
You should now be able to debug and run the project using PyCharm. PyCharm will listen to any changes you make and restart the Horizon server automatically.
Note: When executing the project via PyCharm Run / Debug, you could get an error page after trying to login: “Page not found (404)”. To resolve that - remove the port from the browser URL bar, then login. You should be able to login without it. After a successful login bring the port back - it will continue your session.
Further notes
If you need help with PyCharm and general debugging, please refer to: JetBrains PyCharm developer guide
If you would like to manually restart the apache server, open a terminal and run:
$ sudo service apache2 restart
(if not under Ubuntu, replace “sudo” with an identical command)