The sample plugin and extension for a tutorial about how can we develop a ckan plugin.
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|---|
2.8 and earlier | No |
2.9 | Yes |
To install ckanext-my-first-cool-extension:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
-
Clone the source and install it on the virtualenv
git clone https://github.com//ckanext-my-first-cool-extension.git cd ckanext-my-first-cool-extension pip install -e . pip install -r requirements.txt python setup.py develop
-
Add
my_cool_new_plugin
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini
). -
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service supervisor reload sudo service apache2 reload
To run the tests, do:
pytest --ckan-ini=test.ini