2
0

import_export.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. Import/Export
  2. =============
  3. CRX includes the ability to import pages from CSV files. This is useful for
  4. example in a store locator, where a list of stores needs to be uploaded
  5. periodically.
  6. To start an import, go to **Settings > Import**
  7. In the CSV each row will be a new page and each column header will correspond to an attribute
  8. of that page. On the import CSV page, you will select where you want the pages to live and what
  9. page type they should be created as. A use case for this functionality would be if your site needs
  10. to add several hundred locations as pages. These locations come from a CSV dump from some report
  11. generating software. Your CSV could look something like this:
  12. .. code-block:: text
  13. title , address , latitude , longitude
  14. Store 1 , 123 Street , 20.909 , -15.32
  15. Store 2 , 456 Avenue , 34.223 , 87.2331
  16. ...
  17. ...
  18. ``title``, ``address``, ``latitude``, ``longitude`` are all fields on your Page model that you will
  19. be importing as.
  20. .. important::
  21. Your CSV file must be encoded as ASCII or UTF-8.
  22. UTF-8-BOM will cause an error.
  23. .. versionchanged:: 0.24
  24. In version 0.24, the ability to import/export pages from JSON was removed.
  25. The Import/Export link in the side menu was also moved to Settings > Import.