在django中运行syncdb的问题 [英] Problem running syncdb in django

查看:262
本文介绍了在django中运行syncdb的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过django文档教程并遇到问题同步mysql。在命令 python manage.py syncdb 我收到以下错误(注意我正在Windows 7中运行):

I am trying to go through the django docs tutorial and having a problem syncing mysql. On the command python manage.py syncdb I get the following error (note I'm running in windows 7):

...
File "C:\python27\lib\site-packages\django\db\backends\mysql\base.py", line 14, in <module>
raise Improperlyconfigured("Error loading Mysqldb module: %s" % e) 
django.core.excepions.Improperlyconfigured: Error loading Mysqldb module: No module named mySQLdb

我已将settings.py中的数据库初始化为:

I have initialized the db in setting.py as:

'ENGINE': 'django.db.backends.mysql', 
'NAME': 'mysite',    #the name I gave in Mysql with 'CREATE DATABASE mysite;'                 
'USER': 'root',                      
'PASSWORD': 'mypassword',   # as set in MysqlInstanceConfig
'HOST': '',                     
'PORT': '',  

那么如何让syncdb正确运行?缺少的模块错误是什么意思,如何更正?

So how do I get syncdb to run correctly? What does the missing module error mean and how do I correct it?

推荐答案

您需要安装python mysql库。
这是一个django相关的在Windows上执行此操作的指南

You need to install the python mysql library. Here is a django-related guide to do this on windows

这篇关于在django中运行syncdb的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆