博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
调试和修改OpenStack中的Horizon部分
阅读量:2347 次
发布时间:2019-05-10

本文共 492 字,大约阅读时间需要 1 分钟。

进入调试模式

Horizon在python的django框架上进行开发,所以可以利用django的manage.py来进行调试。

方式:

  • 关闭apache
  • 进入Horizon目录
  • 执行命令manage.py runserver 0.0.0.0:80

这样修改的代码立刻就可以实现,不用每次都重启apache了

查看变量方式

再没有使用调试模式时,可能需要使用

import logginglogging.info('xxx')

来打日志查看一些变量或者输出,这样显然是比较低效的。推荐的做法是开启调试模式,直接print变量,在终端中直接查看。

另外也可以利用assert命令来查看,因为django本身提供了强大的错误输出界面,再想要查看变量的地方之后,增加

assert False

即可输出trace错误界面,在界面中查看变量即可

经常查看文档

OpenStack的文档越来越完善,在Horizon部分有详细的二次开发文档,具体可以查看

转自:http://yansu.org/2013/03/20/debug-and-modify-openstack-horizon.html

转载地址:http://qkxvb.baihongyu.com/

你可能感兴趣的文章
.MysqlDataTruncation: Data truncation: Data too long for column 'content' at row 1
查看>>
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1146177 > 1048576).
查看>>
Elasticsearch 7.x生产配置
查看>>
AccessDeniedException: /opt/elasticsearch-7.0.0/config/elasticsearch.keystore
查看>>
bootstrap-table 父子表 联动表 完整例子
查看>>
Spring Cloud 2.x完整入门Demo样例(Greenwich版本)
查看>>
Spring Cloud 2.x学习笔记:2、feign改进(Greenwich版本)
查看>>
SpringCloud 2.x学习笔记:3、Hystrix(Greenwich版本)
查看>>
SpringCloud 2.x学习笔记:4、Zuul(Greenwich版本)
查看>>
ajax提交JSON数组及Springboot接收转换为list类
查看>>
SpringCloud 2.x学习笔记:5、Config(Greenwich版本)
查看>>
RabbitMQ安装、配置与入门
查看>>
Java异常
查看>>
Ibatis代码自动生成工具
查看>>
ant build.xml教程详解
查看>>
彻底理解ThreadLocal
查看>>
localhost与127.0.0.1的区别
查看>>
windows下的host文件在哪里,有什么作用?
查看>>
操作系统之字符集
查看>>
OSI和TCP/IP
查看>>