Skip to content

Instantly share code, notes, and snippets.

@amercader
Created May 15, 2012 13:30
Show Gist options
  • Save amercader/2701799 to your computer and use it in GitHub Desktop.
Save amercader/2701799 to your computer and use it in GitHub Desktop.
pycsw / CKAn integration proof of concept
class CSWController(BaseController):
def dispatch(self):
import os
from pycsw.server import server
from pylons import request, response
env = request.environ
pycsw_config = config.get('ckanext.spatial.pycsw.config')
csw = server.Csw(pycsw_config, env)
contents = csw.dispatch_wsgi()
response.headers['Content-Length'] = str(len(contents))
response.headers['Content-Type'] = csw.contenttype
response.status = '200 OK'
return contents
@tomkralidis
Copy link

Update: pycsw can now accept configuration as a Python dict as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment