PacktPublishing / Web-Development-with-Django

Learn to build modern web applications with a Python-based framework
MIT License
189 stars 222 forks source link

Chapter 2: Unable to serialize .csv file #27

Open Boboswitch opened 2 years ago

Boboswitch commented 2 years ago

Hello, I am working on a windows system and using the newest versions of Pycharm and Django. I am coming across an error in the section of chapter 2 titled: Populating The Bookr Project's Database. From the looks of it, some of the commands used in this section are Linux based (like in step 3 using 'rm' for linux and 'del' for windows). The main issue I am having is on step 5 when you have to execute the 'loadcsv' command to populate the sqlite3 database. I found out that on windows 'loadcsv' needs to be changed to 'loaddata' and the '--csv' argument needs to be removed completely. Every time I change one of these variables I get a step further, but now I am completely stuck when I get this error:

CommandError: Problem installing fixture 'reviews/managment/commands/WebDevWithDjangoData': csv is not a known serialization format.

I am pretty new to the Django framework, so any bit of information helps! Thx!

beneboy commented 2 years ago

Hi,

loadcsv is a custom command for Bookr. loaddata is a built in Django command which works with JSON, not CSV data. For Bookr, loadcsv is the right command on either platform.

If you are still running into issues, please let us know any errors from loadcsv and we can assist further.

Cheers