mistral/doc/source/contributor/troubleshooting.rst
junboli a2c1db4b14 Add doc8 rule and check doc/source files
doc8 is a linter for documents and used in openstack-manuals. It is better to enforce
document linters for simple checking. This change is to add doc8 in tox file and fix
line too long in some files.

The current rules are as bellow:
- invalid rst format - D000
- lines should not be longer than 79 characters - D001
- no trailing whitespace - D002
- no tabulation for indentation - D003
- no carriage returns (use unix newlines) - D004
- no newline at end of file - D005

Change-Id: Ibba3f0e1c3f724563deb27bbf4f13a8040799687
Closes-bug: #1709571
2017-08-09 16:50:33 +08:00

2.3 KiB

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:

1. Under File > Settings > Languages and Framework > Django -Enter the following:

  1. Check "Enable Django Support"
  2. Django project root: your file system path to Horizon project root
  3. Settings: openstack_dashboard/settings.py (under your Horizon folder)
  4. Manage script: manage.py (also in your horizon folder)
  5. Click OK

image

  1. Enter debug configurations menu, using the tiny arrow pointing down, left to the "play" icon, or under the run menu

image

  1. In the new window, click the green plus icon and then select "Django server" to create a new Django Server configuration.
  2. In the new window appeared:
  1. Name that configuration Horizon
  2. Enter some port so it won't run on the default (for example - port: 4000)

image

  1. Click on Environment variables button, then in the new window:
  1. Make sure you have PYTHONUNBUFFERED set as 1
  2. Create a new pair - DJANGO_SETTINGS_MODULE : openstack_dashboard.settings
  3. When finished click OK.

image

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)