Djangoでfixtureを読み込む
2018/09/15
累計閲覧数 132 PV
python manage.py loaddata "$p"
python manage.py loaddata ./another/app/fixtures/init_data.yaml --database target_db
# Install
pip install django-autofixture
# setting.py
INSTALLED_APPS = [
'autofixture',
]
# コマンド
python manage.py loadtestdata blog.Category:3 blog.Entry:20
# docker-dev run dev_app
docker-dev run dev_app python manage.py loadtestdata MyPage.MyPageElement:30
# 後ろは、 [app_name].[model_name]:[number]