如下配置即可:
1 DATABASES = { 2 ‘default‘: { 3 ‘ENGINE‘: ‘django.db.backends.mysql‘, # Add ‘postgresql_psycopg2‘, ‘mysql‘, ‘sqlite3‘ or ‘oracle‘. 4 ‘NAME‘: ‘django‘, # Or path to database file if using sqlite3. 5 ‘USER‘: ‘root‘, # Not used with sqlite3. 6 ‘PASSWORD‘: ‘cdnunion‘, # Not used with sqlite3. 7 ‘HOST‘: ‘localhost‘, # Set to empty string for localhost. Not used with sqlite3. 8 ‘PORT‘: ‘3306‘, # Set to empty string for default. Not used with sqlite3. 9 } 10 }
时间: 2024-10-12 23:49:31