今天开始自学python和Django,参照网上的教程来做:http://djangobook.py3k.cn/2.0/ 感觉还可以。
前期准备工作都完成了,就待奇迹的出现,突然控制台报错:
E:\pythonwebproject\pythonweb>python manage.py runserver
Validating models...
Unhandled exception in thread started by <function wrapper at 0x01DE69F0>
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\django\utils\autoreload.py", line 93, in wrapper
fn(*args, **kwargs)
File "C:\Python26\Lib\site-packages\django\core\management\commands\runserver.py", line 92, in inner_r
self.validate(display_num_errors=True)
File "C:\Python26\Lib\site-packages\django\core\management\base.py", line 277, in validate
num_errors = get_validation_errors(s, app)
File "C:\Python26\Lib\site-packages\django\core\management\validation.py", line 35, in get_validation_
for (app_name, error) in get_app_errors().items():
File "C:\Python26\Lib\site-packages\django\db\models\loading.py", line 166, in get_app_errors
self._populate()
File "C:\Python26\Lib\site-packages\django\db\models\loading.py", line 72, in _populate
self.load_app(app_name, True)
File "C:\Python26\Lib\site-packages\django\db\models\loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "C:\Python26\Lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "C:\Python26\Lib\site-packages\django\contrib\auth\models.py", line 21, in <module>
from django.contrib.contenttypes.models import ContentType
File "C:\Python26\Lib\site-packages\django\contrib\contenttypes\models.py", line 127, in <module>
class ContentType(models.Model):
File "C:\Python26\Lib\site-packages\django\db\models\base.py", line 88, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
TypeError: Error when calling the metaclass bases
__init__() keywords must be strings
网上找了许久,最后竟然是版本问题导致,我用的是python2.6,Django1.6.2(目前最新),是Django版本高导致,换了一个Django1.2.7的,问题解决。
相关推荐
Python 出现错误TypeError: ‘NoneType’ object is not iterable解决办法 TypeError: ‘NoneType’ object is not iterable 这个错误提示一般发生在将None赋给多个值时。 def myprocess(): a == b if a != b: ...
主要介绍了JQuery报错"Uncaught TypeError: Illegal invocation"的处理方法,需要的朋友可以参考下
TypeError: cannot concatenate ‘str’ and ‘int’ objects print str + int 的时候就会这样了 python + 作为连接符的时候,不会自动给你把int转换成str 补充知识:TypeError: cannot concatenate ‘str’ and ...
主要介绍了Ajax方式上传文件报错"Uncaught TypeError: Illegal invocation",非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
在调整loss计算的时候遇到了TypeError: only integer tensors of a single element can be converted to an index这个问题,原来的计算公式为: self.loss_D = (self.loss_D_fake + self.loss_D_real) * 0.5 调整后...
主要介绍了解决Python中报错TypeError: must be str, not bytes问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文件,标注错误的地方是这样的一段代码: import {normalTime} from './timeFormat'; module....
主要介绍了Vue 报错TypeError: this.$set is not a function 的解决方法,分享给大家,需要的朋友们下面随着小编来一起学习学习吧
title: 'Vue.js路由报错:TypeError: Cannot read property ''_c'' of undefined'错误详情:像上面这
TypeError: loop of ufunc does not support argument 0 of type Tensor which has no callable arctan method 报错行 self.u = np.round(np.dot(self.F, self.u)) #或者 self.u = np.round(self.u + np.dot(K, ...
TypeError: Unexpected keyword argument passed to optimizer: learning_rate 3.问题定位: 先看报错代码:大概意思是, 传给优化器的learning_rate参数错误。 模型训练是在服务器Linux环境下进行的,之后在...
为大家分享了一个解决jquery插件:TypeError:$.browser is undefined报错的方法,解决报错问题的方法也很简单,需要解决此类问题的朋友不要错过这篇文章。
TypeError: notify.sendNotifybyWxPucher is not a function!
TypeError: list indices must be integers or slices, not str 这个错误,这里就分析一下为什么会报错以及如何解决。 这个错误的意思是’类型错误:list的索引必须是’integers’或者’slices’不能是’str’ 我...
本文研究的主要是Python使用pickle模块存储数据报错解决方法,以代码的形式展示,具体如下。 首先来了解下pickle模块 pickle提供了一个简单的持久化功能。...TypeError: write() argument must be str, not byte
资源(241条消息)Python中报错“TypeError:‘list‘objectisnotcallable”的解决方法知识分享
TypeError: ‘required’ is an invalid argument for positionals 的解决方法 当我在使用argparse模块时,遇到了如下错误: import argparse parser = argparse.ArgumentParser(description = 'debug_example') ...