Es ist ärgerlich, also füge den Git-Diff von mysite / settings.py
ein.
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'
Initialisieren Sie die Datenbank und definieren Sie das Registrierungsziel des Verwaltungskontos und verschiedene daran angehängte Tabellen.
$ 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
Es scheint, dass die alte Version von Django Sie auffordert, einen Benutzer zu erstellen, wenn Sie die Datenbank initialisieren, aber ich habe es nicht gehört, also habe ich es selbst gemacht.
$ 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.
Ich war wütend, weil mein Passwort auf dem Weg kurz war.
Führen Sie als Nächstes [App generieren] aus (http://qiita.com/shoota_github/items/48236ed1bbb55ccfa4ae).
Recommended Posts