打開efong/settings.py文件,修改DATABASES字段為:
使用mysqlDATABASES = {'default': {'ENGINE': 'django.db.backends.mysql','NAME': 'efong_web','USER': 'root','PASSWORD': '12345678','HOST': '127.0.0.1','PORT': '3306',}}如果使用pqsqlDATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'testdb', # 數(shù)據(jù)庫(kù)名字(需要先創(chuàng)建) 'USER': 'postgres', # 登錄用戶名 'PASSWORD': '12345678', # 密碼 'HOST': '', # 數(shù)據(jù)庫(kù)IP地址,留空默認(rèn)為localhost 'PORT': '5433', # 端口 }}