Complete the code to set the default database engine in Django settings.
DATABASES = {
'default': {
'ENGINE': '[1]',
'NAME': BASE_DIR / 'db.sqlite3',
}
}The default database engine for Django projects is SQLite, specified as 'django.db.backends.sqlite3'.
Complete the code to specify the database NAME for a PostgreSQL database in Django settings.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '[1]',
'USER': 'myuser',
'PASSWORD': 'mypassword',
'HOST': 'localhost',
'PORT': '5432',
}
}The 'NAME' key should be the name of your PostgreSQL database, such as 'mydatabase'.
Fix the error in the database configuration by completing the missing key for the database user.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydb',
'[1]': 'admin',
'PASSWORD': 'secret',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}The correct key for the database username in Django settings is 'USER'.
Fill both blanks to configure a PostgreSQL database with the correct engine and port.
DATABASES = {
'default': {
'ENGINE': '[1]',
'NAME': 'mydb',
'USER': 'user',
'PASSWORD': 'pass',
'HOST': 'localhost',
'PORT': '[2]',
}
}PostgreSQL uses the engine 'django.db.backends.postgresql' and default port '5432'.
Fill all three blanks to configure a MySQL database with correct engine, host, and port.
DATABASES = {
'default': {
'ENGINE': '[1]',
'NAME': 'mydb',
'USER': 'user',
'PASSWORD': 'pass',
'HOST': '[2]',
'PORT': '[3]',
}
}MySQL uses the engine 'django.db.backends.mysql', default host '127.0.0.1', and default port '3306'.