Question

Need to keep the size of the package down, so is it possible to compress the initial data in some supported format for syncdb to pickup?

Was it helpful?

Solution

.tgz implies an archive of more than one file; it's the suffix for a gzipped Tape Archive file. Django's loaddata does not support it.

Syncdb uses the loaddata command to load initial data. If you gzip your file, in which case it will have an extensions of .gz, then yes, syncdb will successfully load your data. According to the source code, syncdb can load uncompressed files, gzip files, bzip2 files (if you have bz2.py python module), and ZIP archives containing a single file within. They must still be named with the Django convention, e.g.:

filename.json.zip (must contain a single file, "filename.json")
filename.yaml.gz
filename.json.bz2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top