Writing my first Django app - 2
2020-07-26 本文已影响0人
游文影月志
1. Database setup
mysite/settings.py
1.1 DATABASES
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
'ENGINE
:
Value | Database |
---|---|
'django.db.backends.sqlite3' |
SQLite |
'django.db.backends.postgresql' |
PostgreSQL |
'django.db.backends.mysql' |
MySQL |
'django.db.backends.oracle' |
Oracle |
By default, the configuration uses SQLite.
1.2 TIME_ZONE
Setting TIME_ZONE to my time zone.
TIME_ZONE = 'Asia/Shanghai'