Help How to create an extension

Navigate

    With GeoKey 0.3 we introduced an easy way to add functionality to GeoKey by creating and installing extensions. This guide explains how to create and register your awesome extension.

    Start developing

    We created a boilerplate for GeoKey extensions that you can use as a starting point for your own extension.

    1. Download and unzip the boilerplate.

    2. Rename all occurrences of geokey_extension and geokey-extension with the name of your Python package (e.g. geokey_awesome_package and geokey-awesome-package) and GeoKey Extension with a title of your extension (e.g. My Awesome Extension). Don’t forget to rename the directories accordingly.

    3. Now install the extension using python-pip. Just move to the extension’s root directory and install the extension for development:

    pip install -e .
    

    4. Register the extension with GeoKey.

    Add the package to installed apps in settings/settings.py:

    INSTALLED_APPS += (
        ...
        'geokey_awesome_package'
    )
    

    You are now ready to go.

    Add the extension to the admin pages

    You can add extension specific pages to GeoKey’s administration. The link will then appear in the users dashboard under Extensions. Note, that GeoKey expects the landing page to your extension at the named URL pattern geokey_awesome_package:index.

    To register the extension, open __init__.py in the app root and set:

    display_admin=True,
    

    You can also restrict the extension to superusers of the system. That way only superusers can access the admin pages of your extension and make change to its setup. Simply set:

    superuser=True,