Discussions
Activity
Sign In
How it works
Superdesk Development
Setting up locations and categories in Superdesk
Vote Up
0
Vote Down
Trond Husø
June 2018
Posts: 62
Member
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
Votes
Date Added
Vote Up
1
Vote Down
Petr Jasek
June 2018
Posts: 144
Member
hi,
yes we do it eg here:
https://github.com/superdesk/superdesk-ntb/blob/master/server/data/vocabularies.json#L2-L23
just when you run manage.py app:initialize_data run it once more with -p <path to data>
Vote Up
0
Vote Down
Trond Husø
June 2018
Posts: 62
Member
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
Vote Up
0
Vote Down
Trond Husø
June 2018
Posts: 62
Member
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 Up
0
Vote Down
Petr Jasek
June 2018
Posts: 144
Member
I think it should be just -p ./data/ , you can try adding -f that should force the update
Vote Up
0
Vote Down
Trond Husø
June 2018
Posts: 62
Member
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 Up
0
Vote Down
Petr Jasek
June 2018
Posts: 144
Member
yep data for each resource should be in its own file, locators have a specific resource
Vote Up
0
Vote Down
Trond Husø
June 2018
Posts: 62
Member
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
Add a Comment
Start a New Discussion
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
8,397
Sourcefabric
↳
Announcements
25
Newscoop
↳
Newscoop Support
2,189
↳
Newscoop Development
722
↳
Newscoop Security
13
↳
Newscoop Documentation
17
↳
Newscoop Themes
69
Airtime
↳
Airtime Support
3,139
↳
Airtime Development
1,286
↳
Airtime Français
146
↳
Airtime Documentation
14
↳
Airtime Hacks
102
↳
Promote your station!
37
↳
Airtime Security
11
Booktype
↳
Booktype Support
277
↳
Booktype Development
55
↳
Booktype Documentation
7
Superdesk
↳
Superdesk Development
264
↳
Web Publisher
21
Poll
No poll attached to this discussion.
Top Posters
Albert FR
1978
Martin Konecny
1860
Andrey Podshivalov
1526
Voisses Tech
1423
John Chewter
899
Daniel James
844
Roger Wilco
784
hoerich
627
Paul Baranowski
389
Cliff Wang
339