Django: 'module' object has no attribute 'index'
来源:互联网 发布:druid优化 编辑:程序博客网 时间:2024/04/29 16:31
凡出言,信为先;诈与妄,奚可焉。
最近在学习Django的官方文档,编写自己的web app管理界面,在第三章节时,程序会给提示:'module' object has no attribute 'index',各种找stackoverflow查阅相似问题帖子,一遍又一遍的看代码,还重写了两次代码,还是报错。
首先我想是不是版本的问题,通过在终端下输入以下指令,得到的版本跟文档的版本一样后,转战检查是不是index函数写错了位置:
python -c "import django; print(django.get_version())"比对官方文档,发现并没有写错,按照程序调用的流程,应该是没问题,百思不得其解后,因为一些问题耽误了,就没有完成。第二天来的时候,奇迹发生了,我发现打开views.py文件后,没有看到昨天写的Index函数,秒懂!我使用的是tmux多屏显示,使用vim编辑了我的views.py程序后,并没有保存下来,所以才找不到index函数,去撞墙的心都有了。因为我重写第二次代码仍然犯了这个错误,潜意识和习惯真是个可怕的东西。程序给出的错误提示还是要认真分析,一般来说还是挺准确的。
世界上没有无缘无故的恨,也没有无缘无故的爱,更没有无缘无故的bug
0 0
- Django: 'module' object has no attribute 'index'
- 'module' object has no attribute 'JSONField' Django REST framework
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: 'module' object has no attribute 'Serial'
- 'module' object has no attribute 'rindex'
- AttributeError: 'module' object has no attribute(转)
- AttributeError: 'module' object has no attribute 'randint'
- AttributeError: 'module' object has no attribute 'HAVE_DECL_MPZ_POWM_SEC'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'module' object has no attribute 'LabelMap'
- AttributeError: 'module' object has no attribute 'XXX'
- AttributeError: 'module' object has no attribute 'urlopen'
- AttributeError:'module' object has no attribute 'classify'
- AttributeError: ‘module’ object has no attribute’xxx’
- AttributeError: ‘module’ object has no attribute’ 问题
- AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'
- AttributeError: 'module' object has no attribute 'AF_INET'
- 黑马程序员-----@class的使用
- android内存管理
- 正则表达式
- #13 LeetCode——Roman to Integer
- UVA 10570 Meeting with Aliens
- Django: 'module' object has no attribute 'index'
- mysql分库分表
- 比较实用的ADT快捷键
- 51nod 算法马拉松6(索函数)(规律题目)
- 【内存优化】SparseArray源码分析
- XML_SAX_解析本地文件
- spring整合hibernate配置注解事务的相关问题
- Android 广播接收
- DNS 安全威胁