0
votes

I'm following these instructions to create a plugin for custom metadata fields in CKAN. I've successfully created this plugin, and used a snippet to allow the user to choose from a bunch of hard coded tags. I'm able to deploy this plugin to my CKAN instance, and have made modifications to the code and seen the results, but now appear to be unable to do so.

I modify my code in here: /usr/lib/ckan/default/src/ckanext-extrafields/ckanext/extrafields/plugin.py

And then run:

python setup.py develop
python setup.py egg_info

But I don't see the changes populate in my interface. I'm modifying the hard coded tags, and they don't change at all. I've tried clearing my cache, opening the page in other browsers, etc. What other steps should I take?

2
Are you restarting the server (paster or Apache) after the changes? - amercader
Yes-- restarting apache (sudo service apache2 restart) after those changes. To someone unfamiliar with CKAN (and Linux, and python web development in general), it seems like the python script is getting cached somewhere. Does that make any sense? - Charlie Lefrak

2 Answers

0
votes

What are you calling your plugin? Check your entry in setup.py. If it's one of the entries in ckan's setup.py (example_idatasetform), then it won't work. You need to give it a different name. It seems like it works because it's not using your code. It's using the example code shipped with CKAN to test the documentation.

I've fallen into this trap once :)

0
votes

Did you add extrafields tag into ckan.plugins in the .ini files?

Could be possible that you are testing changes on the development environment or also on production?

I used to execute:

python setup.py develop //development
python setup.py install //production

And:

http://127.0.0.1:5000 -> to access to development deployment
http://127.0.0.1      -> to access to production deployment