我正在运行 Openstack 云系统。我在服务器上安装并部署了kilo版本成功,但这只是Openstack的默认版本。因此,我想对这个 openstack 源代码进行一些修改并为其添加更多功能。
我开始用 Openstack Dashboard 改变一些东西。但是,也出现了一些问题。因此,我调试了这个 django web 应用程序。我配置的所有内容都与 openstack 网站 ( http://docs.openstack.org ) 上的官方教程相同。
因此,我在我的服务器上进行了搜索,并找出了 2 个有来源的地方:
- 第一个是 /usr/share/openstack-dashboard/
- 第二个是/usr/lib/python2.7/dist-packages/horizon/
- 配置文件是 /etc/openstack-dashboard/local_settings.py
我在 local_settings.py 文件中设置了选项 Debug = True 。
在服务器上,我输入了以下命令:
cd /usr/share/openstack-dashboard/
python manage.py runserver
这是输出:
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.
但是在浏览器中,它显示错误:
然后,在控制台上,它显示:
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
请帮助我摆脱这个问题。以及如何正确调试 Openstack Django 网站。非常感谢!