How to Dumpdata in UTF-8 in Django

Опубликовано: 05 Февраль 2022
на канале: Zack Plauché
1,546
31

If you've ever had an issue where certain characters weren't getting dumped correctly from your Django database, this one's for you 🙂 .

tl;dr:
Insert -Xutf8 right after python in your manage.py dumpdata command, like so:
python -Xutf8 manage.py dumpdata -o data.json

I also answered this (and found this) in a stackoverflow article: https://stackoverflow.com/a/70998418/...

---
Want me to help teach you code? You can reach out to me via Codementor.io and I'd love to help you 🙂.

Here's my codementor profile: https://www.codementor.io/@zackknowsp...

---
My Links:
My Website: https://www.zackplauche.com/
Codementor: https://www.codementor.io/@zackknowsp...
Wyzant: https://www.wyzant.com/Tutors/LearnPy...
GitHub: https://github.com/ZackPlauche
Stack Overflow: https://stackoverflow.com/users/10415...