Dump and Load Data

data dumping ν•˜κΈ°

python manage.py dumpdata

dump ν•œ dataλ₯Ό data.json file둜 λ§Œλ“€κΈ°

python manage.py dumpdata > data.json

fixtures directory λ§Œλ“€κΈ°

.
β”œβ”€β”€ accounts
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ apps.py
β”‚   β”œβ”€β”€ forms.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ migrations
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ templates
β”‚   β”‚   └── accounts
β”‚   β”‚       β”œβ”€β”€ login.html
β”‚   β”‚       β”œβ”€β”€ profile.html
β”‚   β”‚       β”œβ”€β”€ signup.html
β”‚   β”‚       └── update.html
β”‚   β”œβ”€β”€ tests.py
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ articles
β”‚   β”œβ”€β”€ admin.py
β”‚   β”œβ”€β”€ apps.py
β”‚   β”œβ”€β”€ fixtures
β”‚   β”‚   └── articles
β”‚   β”‚       └── data.json
β”‚   β”œβ”€β”€ forms.py
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ migrations
β”‚   β”‚   β”œβ”€β”€ 0001_initial.py
β”‚   β”‚   β”œβ”€β”€ 0002_comment.py
β”‚   β”‚   β”œβ”€β”€ 0003_auto_20200505_2001.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ templates
β”‚   β”‚   └── articles
β”‚   β”‚       β”œβ”€β”€ comment.html
β”‚   β”‚       β”œβ”€β”€ form.html
β”‚   β”‚       β”œβ”€β”€ index.html
β”‚   β”‚       └── like.html
β”‚   β”œβ”€β”€ templatetags
β”‚   β”‚   β”œβ”€β”€ article_extras.py
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   └── __pycache__
β”‚   β”‚       β”œβ”€β”€ article_extras.cpython-36.pyc
β”‚   β”‚       β”œβ”€β”€ hashtags.cpython-36.pyc
β”‚   β”‚       └── __init__.cpython-36.pyc
β”‚   β”œβ”€β”€ tests.py
β”‚   β”œβ”€β”€ urls.py
β”‚   └── views.py
β”œβ”€β”€ a.txt
β”œβ”€β”€ crud
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ settings.py
β”‚   β”œβ”€β”€ urls.py
β”‚   └── wsgi.py
β”œβ”€β”€ db.sqlite3
β”œβ”€β”€ latest.dump
β”œβ”€β”€ manage.py
β”œβ”€β”€ media
β”œβ”€β”€ Procfile
β”œβ”€β”€ README-images
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ runtime.txt
β”œβ”€β”€ src
β”‚   └── django-debug-toolbar
β”œβ”€β”€ static
β”‚   β”œβ”€β”€ css
β”‚   └── js
β”œβ”€β”€ templates
β”‚   β”œβ”€β”€ _accountdelete.html
β”‚   β”œβ”€β”€ base.html
β”‚   β”œβ”€β”€ _commentdelete.html
β”‚   β”œβ”€β”€ _deletemodal.html
β”‚   β”œβ”€β”€ _nav.html
β”‚   └── _replies.html
└── tree.txt

117 directories, 324 files

loaddata

$ python manage.py loaddata articles/data.json
Installed 113 object(s) from 1 fixture(s)

Last updated

Was this helpful?