LoginSignup
1
0

More than 5 years have passed since last update.

DjangoのDBを初期化してリストアする手順

Posted at

この記事について

ただの備忘録です。すみません。
こんな備忘録でも役に立てばいいかなと思います。

使用環境

CentOS 7.5
Python 3.6.5
Django 2.1.2

手順

MySQL
DROP DATABASE [DB];
CREATE DATABASE [DB] CHARACTER SET utf8mb4;

ここでDjangoのmigrationファイルを消します。

コンソール
python manage.py makemigrations [アプリ名]
python manage.py migrate
python manage.py loaddata [アプリ名]/fixtures/app.json
systemctl restart httpd

最後に

もっとスマートな方法あればコメントいただけたら幸いです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0