我运行python33的,我已经安装了pymysql3但我需要什么ENGINE指定在Django的设置:什么是pymysql3相当于django.db.backends.mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'chris_test', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'some_user',
'PASSWORD': 'some password',
'HOST': 'some_host', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '3306', # Set to empty string for default.
}
}
是否有一个原因,标准的'django.db.backends.mysql'不能使用?为什么你需要Django来使用PyMySQL? – voithos 2013-03-13 19:26:29
因为我不能在我的Windows机器上安装MySQLdb,因为不兼容的行为和奇怪的概念(至少对Windows用户),我应该必须安装一个C编译器,以便我可以使用一种语言这应该是更容易。 – 2013-03-13 19:39:40
需要C编译器来编译Python扩展。在Python中工作很简单,很棒 - 但并不总是很快。对于像数据库客户端那样(据称)至关重要的事情,您希望它尽可能快。 – voithos 2013-03-13 20:00:58