Skip to content

Installation

Path variables used below: - $INSTALL_FOLDER (i.e. where CKAN is installed), e.g. /usr/lib/ckan/default - $CONFIG_FILE, e.g. /etc/ckan/default/development.ini

Installing from PyPI

pip install ckanext-attribution
# to use the CLI as well:
pip install ckanext-attribution[cli]

Installing from source

  1. Clone the repository into the src folder:

    cd $INSTALL_FOLDER/src
    git clone https://github.com/NaturalHistoryMuseum/ckanext-attribution.git
    

  2. Activate the virtual env:

    . $INSTALL_FOLDER/bin/activate
    

  3. Install via pip:

    pip install $INSTALL_FOLDER/src/ckanext-attribution
    # to use the cli as well:
    pip install $INSTALL_FOLDER/src/ckanext-attribution[cli]
    

Installing in editable mode

Installing from a pyproject.toml in editable mode (i.e. pip install -e) requires setuptools>=64; however, CKAN 2.9 requires setuptools==44.1.0. See our CKAN fork for a version of v2.9 that uses an updated setuptools if this functionality is something you need.

Post-install setup

  1. Add 'attribution' to the list of plugins in your $CONFIG_FILE:

    ckan.plugins = ... attribution
    

  2. Install lessc globally:

    npm install -g "less@~4.1"
    

  3. Add this block to package_metadata_fields.html to show the Vue app:

    {% block package_custom_fields_agent %}
         {{ super() }}
    {% endblock %}
    

  4. Change the authors field in your SOLR schema.xml to set up faceting.

    <schema>
        <fields>
            <...>
            <field name="author" type="string" indexed="true" stored="true" multiValued="true"/>
            <...>
        </fields>
        <...>
        <copyField source="author" dest="text"/>
    </schema>
    

After making the changes, restart SOLR and reindex (ckan -c $CONFIG_FILE search-index rebuild). You will also have to enable the config option (see below) to see this in the UI.