Skip to content

alphagov-mirror/ckanext-datagovuk

 
 

ckanext-datagovuk

Features

  • Configures Sentry automatically using a SENTRY_DSN environment variable.

Installation

To install ckanext-datagovuk:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
    
  2. Install the ckanext-datagovuk Python package into your virtual environment:

    pip install ckanext-datagovuk
    
  3. Add datagovuk to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini).

  4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload
    

Config Settings

Document any optional config settings here.

  • ckan.datagovuk.trim_strings_for_index_limit: when indexing packages, string fields will be truncated to this length unless they are known to be under a text-indexed key. Solr 6 has a field limit of 32k for string fields, but note that our truncation is applied per-json-value, and a Solr value can contain multiple json values which then get squashed together to a single field value, so using a number under half Solr's limit is wise.

Development Installation

To install ckanext-datagovuk for development, activate your CKAN virtualenv and do:

git clone https://github.com/alphagov/ckanext-datagovuk.git
cd ckanext-datagovuk
python setup.py develop
pip install -r dev-requirements.txt

Running the Tests

To run the tests, do:

nosetests -v --nologcapture --with-pylons=test.ini --ckan ckanext.datagovuk

To run the tests and produce a coverage report, first make sure you have coverage installed in your virtualenv (pip install coverage) then run:

nosetests -v --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.datagovuk --cover-inclusive --cover-erase --cover-tests --ckan ckanext.datagovuk

Creating test data

In order to be able to run the (CKAN functional tests)[https://github.com/alphagov/ckan-functional-tests] we need to create test data.

Before running the paster command set the environment varibales: - CKAN_INI - location of CKAN ini file, this is already set on the docker stack - CKAN_TEST_SYSADMIN_NAME and CKAN_TEST_SYSADMIN_PASSWORD

Then run the paster command:

paster --plugin=ckanext-datagovuk create_dgu_test_data -c $CKAN_INI

In order to remove the test data:

paster --plugin=ckanext-datagovuk remove_dgu_test_data -c $CKAN_INI

About

CKAN extension for data.gov.uk

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 79.2%
  • HTML 18.9%
  • Shell 1.1%
  • CSS 0.8%