2 from oai.handlers import Catalogue
3 from oaipmh.server import ServerBase, oai_dc_writer, NS_OAIDC, NS_DC, NS_XSI
4 from oaipmh.metadata import MetadataRegistry
5 from django.http import HttpResponse
6 from lxml.etree import tostring
8 metadata_registry = MetadataRegistry()
9 metadata_registry.registerWriter('oai_dc', oai_dc_writer)
10 ns_map = {'oai_dc': NS_OAIDC, 'dc': NS_DC, 'xsi': NS_XSI}
12 server = ServerBase(Catalogue(), metadata_registry, ns_map)
16 resp = server.handleRequest(request.GET)
17 return HttpResponse(resp)