X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifoldapi%2Fmanifoldproxy.py;h=458c084a560410b57be8447033bee06d60d0d287;hb=b7fc87dd0267474f721d5c2265e7bf1df6ff7078;hp=0f700bf7c3f5cfc14c24144bdba15a6e3a7542f0;hpb=f53df6493de6aa133220ea102b1ce42a3df87d11;p=myslice.git diff --git a/manifoldapi/manifoldproxy.py b/manifoldapi/manifoldproxy.py index 0f700bf7..458c084a 100644 --- a/manifoldapi/manifoldproxy.py +++ b/manifoldapi/manifoldproxy.py @@ -8,8 +8,8 @@ from django.http import HttpResponse, HttpResponseForbidden #from manifoldapi.manifoldquery import ManifoldQuery from manifold.core.query import Query from manifold.core.result_value import ResultValue -from manifoldapi import ManifoldAPI -from manifoldresult import ManifoldException +from manifoldapi import ManifoldAPI +from manifoldresult import ManifoldException # from unfold.sessioncache import SessionCache @@ -31,7 +31,12 @@ debug_empty=False # myslice/urls.py # as well as # static/js/manifold.js -def proxy (request,format): +def proxy(request, format): + from myslice.settings import config + url = config.manifold_url() + return _proxy(url, request, format) + +def _proxy(url, request, format): """the view associated with /manifold/proxy/ with the query passed using POST""" # expecting a POST @@ -71,7 +76,7 @@ def proxy (request,format): return HttpResponse (json.dumps({'code':0,'value':[]}), content_type="application/json") # actually forward - manifold_api= ManifoldAPI(auth=manifold_api_session_auth) + manifold_api= ManifoldAPI(url, auth=manifold_api_session_auth) # for the benefit of the python code, manifoldAPI raises an exception if something is wrong # however in this case we want to propagate the complete manifold result to the js world