C'est ennuyeux, alors collez le git diff de 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'
Initialisez la base de données et définissez la destination d'enregistrement du compte de gestion et des différentes tables qui lui sont attachées.
$ 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
Il semble que l'ancienne version de Django vous demandera de créer un utilisateur lorsque vous initialiserez la base de données, mais je ne l'ai pas entendu, donc je l'ai fait moi-même.
$ 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.
J'étais en colère parce que mon mot de passe était court sur le chemin.
Ensuite, faites Generate App
Recommended Posts