Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time



Standard CKAN plugin installation

plugins = ... datacity

Includes ckanext-scheming schemas, to use, add the following to config:

plugins = ... scheming_datasets scheming_groups

scheming.dataset_schemas = ckanext.datacity:scheming-dataset.json ckanext.datacity:scheming-app.json
scheming.group_schemas = ckanext.datacity:scheming-group-settings.json ckanext.datacity:scheming-group-automation.json

datacity.settings_group_id = settings

Local plugin development


  • Verify Python version, it should be Python 2.7: python --version
  • Install Python virtualenv: sudo apt-get install python-virtualenv
  • Install Docker & Docker Compose
  • Clone of hasadna/ckan-cloud-docker at ../ckan-cloud-docker


virtualenv --python python2 venv
. venv/bin/activate
pip install setuptools==36.1
pip install -e 'git+'
pip install -r venv/src/ckan/requirements.txt
docker-compose up -d redis solr db
docker-compose exec -u postgres db createuser -S -D -R -P ckan_default
docker-compose exec -u postgres db createdb -O ckan_default ckan_default -E utf-8
mkdir venv/etc
paster make-config ckan venv/etc/development.ini
ln -s `pwd`/venv/src/ckan/who.ini `pwd`/venv/etc/who.ini
mkdir venv/storage

Edit the created config file (venv/etc/development.ini) and set the following:

sqlalchemy.url = postgresql://ckan_default:pass@
solr_url =
ckan.site_url = http://localhost:5000
ckan.storage_path = /absolute/path/to/venv/storage

Create the DB tables:

paster --plugin=ckan db init -c venv/etc/development.ini

Install the datacity CKAN requirements:

pip install -r ../ckan-cloud-docker/ckan/requirements.txt

Install the datacity plugin

pip install -e .

Edit the configuration (venv/etc/development.ini):

add datacity to ckan.plugins

Create admin user

paster --plugin=ckan sysadmin add admin -c venv/etc/development.ini

(optional) to enable debugging - install dev requirements - pip install -r venv/src/ckan/dev-requirements.txt and set debug=true in venv/etc/development.ini

(optional) copy relevant ckan configs from an existing datacity instance in hasadna/datacity-k8s/instances/INSTANCE_NAME/values.yaml to venv/etc/development.ini

Start the development server

docker-compose up -d redis solr db
. venv/bin/activate
paster --plugin=ckan serve venv/etc/development.ini

Stop all containers

docker-compose down

Get latest translations from Transifex

Get the Transifex API token


Get the translations and copy to the local CKAN source

for LANG in he ar en_US; do
    echo downloading $LANG &&\
    curl -sL --user api:$TRANSIFEX_API_TOKEN -X GET "$LANG/?mode=default&file" > venv/src/ckan/ckan/i18n/$LANG/LC_MESSAGES/ckan.po &&\
    echo compiling $LANG &&\
    msgfmt -o venv/src/ckan/ckan/i18n/$LANG/LC_MESSAGES/ venv/src/ckan/ckan/i18n/$LANG/LC_MESSAGES/ckan.po &&\
    echo OK

Updating source translation strings

This should be done when changes are made to either the source CKAN version or to the datacity extension

Activate the local development server with the relevant CKAN version (following the instructions above for local plugin development)

. venv/bin/activate

Install translation requirements

pip install --upgrade Babel transifex-client

Update the .pot files

python extract_messages &&\
( cd venv/src/ckan && python extract_messages )

Merge the .pot files

msgcat venv/src/ckan/ckan/i18n/ckan.pot ckanext/datacity/i18n/ckanext-datacity.pot > ckanext/datacity/i18n/ckan-datacity.pot

Get a Transifex API token


Set transifex auth file

echo "[]
api_hostname =
hostname =
username = api
" > ~/.transifexrc

Push the updated .pot file

tx push -s

Enabling datastore and xloader for local development


docker-compose exec -u postgres db createuser -S -D -R -P -l datastore_default
docker-compose exec -u postgres db createdb -O ckan_default datastore_default -E utf-8

Edit venv/etc/development.init:

  • Add to ckan.plugins: datastore xloader
  • ckan.datastore.write_url = postgresql://ckan_default:123456@
  • ckan.datastore.read_url = postgresql://datastore_default:123456@
  • ckanext.xloader.unicode_headers = True

set datastore permissions

paster --plugin=ckan datastore -c venv/etc/development.ini set-permissions | docker-compose exec -T -u postgres db psql


Start CKAN normally

Start the Jobs service

. venv/bin/.activate
paster --plugin=ckan jobs -c venv/etc/development.ini worker