Skip to content

Ckan extension adding additional fields and controls for spectral data

Notifications You must be signed in to change notification settings

CSTARS/ckanext-ecosis

Repository files navigation

ckanext-ecosis

EcoSIS extension for CKAN adding resource controls for spectra

EcoSIS Tutorials

tutorial.ecospectra.org

CKAN 'IDE'

info on pycharm package install can be found here

start pycharm

. /usr/lib/ckan/default/bin/activate
# run ckan as root

sudo pycharm-community

run setup

select virtual env python as interpreter, then

script = /usr/lib/ckan/default/bin/paster
script paramters = --plugin=ckan serve /etc/ckan/default/development.ini

Allow local cross-site auth (dev only)

in ckan/lib/base.py

     def _set_cors(self):
-        response.headers['Access-Control-Allow-Origin'] = "*"
+        #response.headers['Access-Control-Allow-Origin'] = "*"
+        if 'Origin' in request.headers:
+            response.headers['Access-Control-Allow-Origin'] = request.headers['Origin']
+        else:
+            response.headers['Access-Control-Allow-Origin'] = "*"
+
         response.headers['Access-Control-Allow-Methods'] = \
             "POST, PUT, GET, DELETE, OPTIONS"
         response.headers['Access-Control-Allow-Headers'] = \
             "X-CKAN-API-KEY, Authorization, Content-Type"

+        response.headers['Access-Control-Allow-Credentials'] = "true"

About

Ckan extension adding additional fields and controls for spectral data

Resources

Stars

Watchers

Forks

Packages

No packages published