It's annoying, so paste the git diff from mysite / settings.py
.
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+# 'ENGINE': 'django.db.backends.sqlite3',
+# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': '******',
+ 'USER': '******',
+ 'PASSWORD': '******',
+ 'HOST': 'localhost',
+ 'PORT': '3306',
}
}
@@ -103,9 +109,11 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
-LANGUAGE_CODE = 'en-us'
+#LANGUAGE_CODE = 'en-us'
+LANGUAGE_CODE = 'ja'
-TIME_ZONE = 'UTC'
+#TIME_ZONE = 'UTC'
+TIME_ZONE = 'Asia/Tokyo'
Initialize the DB and define the registration destination of the management account and various tables attached to it.
$ python3 manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name.../usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py:101: Warning: (1146, "Table 'mysql.column_stats' doesn't exist")
return self.cursor.execute(query, args)
OK
Applying auth.0002_alter_permission_name_max_length.../usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py:101: Warning: (1146, "Table 'mysql.column_stats' doesn't exist")
return self.cursor.execute(query, args)
OK
Applying auth.0003_alter_user_email_max_length.../usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py:101: Warning: (1146, "Table 'mysql.column_stats' doesn't exist")
return self.cursor.execute(query, args)
OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length.../usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py:101: Warning: (1146, "Table 'mysql.column_stats' doesn't exist")
return self.cursor.execute(query, args)
/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py:101: Warning: (1146, "Table 'mysql.index_stats' doesn't exist")
return self.cursor.execute(query, args)
OK
Applying sessions.0001_initial... OK
It seems that the old version of Django will ask you to create a user when you initialize the DB, but I didn't hear it, so I made it myself.
$ python3 manage.py createsuperuser
Username (leave blank to use 'kumanoshuta'): shoota
Email address:
Password:
Password (again):
This password is too short. It must contain at least 8 characters.
Password:
Password (again):
Error: Your passwords didn't match.
Password:
Password (again):
Superuser created successfully.
I was angry because my password was short on the way.
Next, do Generate App
Recommended Posts