Maintainers guide for dLab open data portal
Installed version of CKAN either in development or production.
- Activate CKAN virtual environment and navigate to CKAN source
$ pyenv shell 3.8.0
$ . /usr/lib/ckan/default/bin/activate
$ cd /usr/lib/ckan/default/src/ckan
- Create a new administrator
ckan -c /etc/ckan/default/ckan.ini sysadmin add dlab_ckan_default email=info@dlab.or.tz name=dlab_ckan_default
Accept to create a new user by press Y
, then press Enter
, then enter a password on the prompt.
Note: A template for creating administrator users is:
ckan -c /etc/ckan/default/ckan.ini sysadmin add <username> email=<email> name=<name>
During development
and testing
phase, test data allow for quick checks if everything works.
- Loading test data into database
ckan -c /etc/ckan/default/ckan.ini seed basic
ckan -c /etc/ckan/default/ckan.ini seed family
ckan -c /etc/ckan/default/ckan.ini seed gov
ckan -c /etc/ckan/default/ckan.ini seed hierarchy
ckan -c /etc/ckan/default/ckan.ini seed search
ckan -c /etc/ckan/default/ckan.ini seed translations
ckan -c /etc/ckan/default/ckan.ini seed user
ckan -c /etc/ckan/default/ckan.ini seed vocabs
Note: Once development is through, remember to clean the database and re-initialize it for production usage.
- Create a directory where CKAN will store uploaded files
$ sudo mkdir -p /var/lib/ckan/default
- Edit CKAN config file to set
cache_dir
andstorage_path
$ sudo vi /etc/ckan/default/ckan.ini
cache_dir = /var/lib/ckan/default/data/
ckan.storage_path = /var/lib/ckan/default
- Set permissions to allow Ngix's user to read, write and execute
$ sudo chown -R www-data /var/lib/ckan/default
$ sudo chmod -R u+rwx /var/lib/ckan/default
$ sudo chown -R `whoami` /var/lib/ckan/default
- Then restart
$ sudo systemctl restart supervisor
or
$ ckan -c /etc/ckan/default/ckan.ini run
- Edit CKAN config file to set
tracking_enabled = true
in the[app:main]
$ sudo vi /etc/ckan/default/ckan.ini
ckan.tracking_enabled = true
- Then restart
$ sudo systemctl restart supervisor
or
$ ckan -c /etc/ckan/default/ckan.ini run