How can I debug the Openstack Dashboard?

I am running Openstack cloud system. I have installed and deployed the kilo version on the server successfully, but this is only the default Openstack version. Thus, I want to make some changes to this original source file and add additional functionality to it.

I started changing things using the Openstack Dashboard. However, there are some problems. So I was debugging this django web app. Everything I have configured is the same as the official tutorials on the openstack website ( http://docs.openstack.org ).

So, I have a search on my server and find out 2 places that have sources:

  • The first one is / usr / share / openstack -dashboard /
  • The second is / usr / lib / python 2.7 / dist-packages / horizon /
  • And the config file: /etc/openstack-dashboard/local_settings.py

I have set the Debug = True setting in the local_settings.py file.

On the server, I typed the following commands:

cd /usr/share/openstack-dashboard/
python manage.py runserver

      

Here's the result:

RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
WARNING:py.warnings:RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
WARNING:py.warnings:RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
Performing system checks...

System check identified no issues (0 silenced).
August 05, 2015 - 09:28:50
Django version 1.7.6, using settings 'openstack_dashboard.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

      

But in the browser it shows an error:

error

And then, on the console, it shows:

Starting development server at http://127.0.0.1:8000/                                                                                                                                                                                                                          
Quit the server with CONTROL-C.                                                                                                                                                                                                                                                
[05/Aug/2015 10:21:29] "GET / HTTP/1.1" 302 0                                                                                                                                                                                                                                  
Not Found: /horizon/auth/login/                                                                                                                                                                                                                                                
[05/Aug/2015 10:21:29] "GET /horizon/auth/login/?next=/ HTTP/1.1" 404 4237                                                                                                                                                                                                     
Not Found: /favicon.ico                                                                                                                                                                                                                                                        
[05/Aug/2015 10:21:29] "GET /favicon.ico HTTP/1.1" 404 4206  

      

Please help me get rid of these problems. And how can you debug Openstack Django Website correctly. Thank you very much!

+3


source to share


3 answers


When starting the server with the runerver command, you must navigate to the root url, for example 127.0.0.1:8000/ not 127.0.0.1:8000/horizon

The difference lies in the startup method. When you installed openstack_dashboard, there is apache config listening on the http: // host / horizon address to look at / etc / apache 2 / conf / sites-available /

Catalogs

/usr/lib/python2.7/dist-packages/horizon/

Similar to the structure of all dashboards

/ Usr / share / openstack-panel /



Default control panel for openstack

/etc/openstack-dashboard/local_settings.py

Configuration file for the control panel. This is where you can apply changes to the default dash, for example, attach your project that modifies or extends the default dash

So your problem will be solved if you follow this link http://127.0.0.1:8000/ For debugging use

pdb or ide with built-in debugger

+2


source


Follow this link. http://docs.openstack.org/developer/horizon/quickstart.html

Once this is done, add pdb instructions to your code you want to debug. Go into the horizon folder and run the following command. / run _tests.sh --runserver 127.0.0.1:port_number



Instead of localhost, you can specify the IP address where horizon is running

0


source


I wrote the OpenStack documentation for debugging dashboards with PyCharm.
(This is fine for any Openstack Dashboard including Horizon) http://docs.openstack.org/developer/mistral/developer/troubleshooting.html

0


source







All Articles