Setting up locations and categories in Superdesk
  • Hi,

    Is there a way to setup a json-file with locations and also one for category that can be used after a fresh install of SD? 
    I have received a json file from someone I am setting SD up for and so I would rather not like to manually type in a lot of locations.

    Best

    Trond

  • 7 Comments sorted by
  • Vote Up1Vote Down Petr JasekPetr Jasek
    Posts: 135Member
    hi,

    just when you run manage.py app:initialize_data run it once more with -p <path to data>
  • When I run manage.py in the server directory/folder I get

    ./manage.py app:initialize_data -p data/vocabularies.json
    Traceback (most recent call last):
      File "./manage.py", line 14, in <module>
        import superdesk
    ImportError: No module named superdesk

  • That error was caused by me running the command under python2.7
    Got a bit better under py3 ...

    I am now running it like this:
    python3 manage.py app:initialize_data -p ./data/vocabularies.json

    But... I am not really seing any changes in superdesk? I have logged out and back in for every re-run of the command.
  • Vote Up0Vote Down Petr JasekPetr Jasek
    Posts: 135Member
    I think it should be just -p ./data/ , you can try adding -f that should force the update
  • Just looking at the folder in ntb-superdesk I see for instance that locations is a separate json file.

    Shall I create separate files for any of the metadata I want to populate?

    I'll try the -p ./data/ first

    t

  • Vote Up0Vote Down Petr JasekPetr Jasek
    Posts: 135Member
    yep data for each resource should be in its own file, locators have a specific resource
  • Created a locators.json, but it wasn't read by SD. So I corrected and updated the one in vocabularies.json-file and that worked.

    So I am currently happy. Do you have a template for the locators-json?

    Soon to start with ingestions also, that's for another thread :)

    T