跟django文档里的第一个学习项目在创建完初始的目录结构修改settings.py连接数据库的参数后,运行
python
manage.py syncdb出现下边的错误提示,下去买包烟希望能有惊喜答复。
E:\django_Site\mysite>python
manage.py syncdb
Traceback (most recent call last):
File "
manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\core\managemen
t\
__init__.py", line 385, in execute_from_command_line
utility.execute()
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\core\managemen
t\
__init__.py", line 354, in execute
django.setup()
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\
__init__.py",
line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\apps\registry.
py", line 108, in populate
app_config.import_models(all_models)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\apps\
config.py", line 197, in import_models
self.models_module = import_module(models_module_name)
File "G:\Python27\lib\importlib\
__init__.py", line 37, in import_module
__import__(name)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\contrib\auth\m
odels.py", line 40, in <module>
class Permission(models.Model):
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\models\base
.py", line 125, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\models\base
.py", line 300, in add_to_class
value.contribute_to_class(cls, name)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\models\opti
ons.py", line 166, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length(
))
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\
__init__.py", line 40, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\
utils.py",
line 242, in __getitem__
backend = load_backend(db['ENGINE'])
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\
utils.py",
line 108, in load_backend
return import_module('%s.base' % backend_name)
File "G:\Python27\lib\importlib\
__init__.py", line 37, in import_module
__import__(name)
File "G:\Python27\lib\site-packages\django-1.7-py2.7.egg\django\db\backends\my
sql\
base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb2 in position 20: invalid
start byte
E:\django_Site\mysite>
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.