📜  将 sqlite 导入 mysql django - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:23.905000             🧑  作者: Mango

代码示例1
python3 manage.py dumpdata > datadump.json
# configure your DATABASES in settings.py
python3 manage.py migrate --run-syncdb
# exclude contenttype data !IMPORTANT

python3 manage.py shell
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
quit()

# import data 
python3 manage.py loaddata datadump.json