Answers for "change db sqlite to postgresql django"

1

how to migrate from sqlite to postgresql django

# when using sqlite3
python manage.py dumpdata > datadump.json
# after chagne db
python manage.py makemigrations
python manage.py migrate --run-syncdb
python manage.py shell
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
quit()
python manage.py loaddata datadump.json
Posted by: Guest on September-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language