我運行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