Customizations for DESQ. This CKAN plugin is not designed to be generic or easily applicable to other data portals. It requires specific changes to the CKAN configuration and the Solr schema.
- Python 3.9
- Ubuntu packages required by PyICU:
sudo apt install libicu-dev python3-icu pkg-config
- CKAN, DESQ fork, installed with:
pip install -e 'git+https://github.com/whiskyechobravo/ckan.git@desq#egg=ckan[requirements]'
Tested under Ubuntu 20.04 and 22.04.
-
Activate your CKAN virtualenv, for example:
. /usr/lib/ckan/default/bin/activate -
Install ckanext-desq in the virtualenv:
pip install -e 'git+https://github.com/whiskyechobravo/ckanext-desq.git#egg=ckanext-desq'That will also install some dependencies (listed in
ckanext-desq/setup.cfg). -
Use
config/ckan/sample.inias a replacement to/etc/ckan/default/ckan.ini, but edit the following settings:beaker.session.secretsqlalchemy.urlapi_token.jwt.encode.secretapi_token.jwt.decode.secretsolr_urlsolr_usersolr_passwordlicenses_group_url(must link tockanext-desq/config/ckan/licenses.json)ckan.storage_path(if need to change from/var/lib/ckan/default)
-
Copy the required webfonts to the
ckanext/desq/public/webfonts/directory. -
Restart CKAN. Assuming it's installed as a systemd service:
sudo service ckan restart
References:
- https://docs.ckan.org/en/2.9/maintaining/database-management.html#import-and-export
- https://docs.ckan.org/en/2.9/maintaining/cli.html#search-index-rebuild-search-index
Backup:
sudo -u postgres pg_dump --format=custom -d ckan_default > desq-$(date +%Y%m%d-%H%M).pgdumpRestore (replace path to .ini file if necessary):
ckan -c /etc/ckan/default/ckan.ini db clean
sudo -u postgres pg_restore --clean --if-exists -d ckan_default < desq-YYYYMMDD-HHMM.pgdump
ckan -c /etc/ckan/default/ckan.ini search-index rebuildReferences:
- https://docs.ckan.org/en/2.9/contributing/i18n.html
- https://docs.ckan.org/en/2.9/extensions/translating-extensions.html
Creating the .pot file:
python setup.py extract_messagesCreating a .po file for a locale:
python setup.py init_catalog --locale LANGUpdating existing translations:
python setup.py update_catalog --locale LANGCompile translations into a .mo file:
python setup.py compile_catalog --locale LANGThe binary .mo file is committed to the repository for ease of deployment.