The extension provides a way to summarize the resource download event. Customized template snippets and summary information pages are also supported.
The extension is compatible with CKAN core 2.3 or later.
Set the configuration to use the plugin :
ckan.plugins = download
# postgresql database to record downloading information
ckan.download.psqlUrl = postgresql://(dbuser):(dbpass)@(dbhost)/(dbname)
After installing the extension, the url path /download and /download_date on the browser show the download summary.
- url /download
- url /download_date
The extension also customizes the template on several sections.
- on dataset, url /dataset
- on dataset info, url /dataset/(dataset)
- on resource, url /dataset/(dataset)/resource/(id)
Set the configuration to customize the template.
# postgresql database to record downloading information
ckan.download.template = true
- The extension also supports the default view tracking in the ckan (2.3 or later).
- Follow the page (http://docs.ckan.org/en/latest/maintaining/tracking.html) to setup view tracking.
- The extension recognizes the configuration below :
[app:main]
ckan.tracking_enabled = true
To install ckanext-download for development, activate your CKAN virtualenv and do :
git clone https://github.com/jiankaiwang/ckanext-download.git
cd ckanext-download
python ./setup.py develop
# run in the develop environment
# assume the development.ini located at /etc/ckan/default
paster serve /etc/ckan/default/development.ini
To install ckanext-download:
- Activate your CKAN virtual environment, for example::
. /usr/lib/ckan/default/bin/activate
- Install the ckanext-download Python package into your virtual environment::
git clone https://github.com/jiankaiwang/ckanext-download.git
cd ckanext-download
python setup.py install
-
Add
download
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
). -
Restart CKAN. For example if you've deployed CKAN with nginx on Ubuntu::
# restart ckan service
sudo service ckan restart
# restart server service
sudo service nginx restart
- jquery.tablesorter : v.2.0.3
- jquery : v.1.12.4
- plotly : v.1.16.2