Conversion reponse JSON en dictionnaire

This commit is contained in:
Paul Marillonnet 2017-02-27 15:14:53 +01:00
parent 15f8fa5e13
commit 4e346d6151
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import os
import json
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
@ -26,7 +27,10 @@ def wcs(request, slug="", wcs_entry_id=0):
#res = ldap_init() #OK
#return HttpResponse("Querying w.c.s "+str(res))
#return HttpResponse(str(wcs_entry_id))
return HttpResponse(str(json_response))
#return HttpResponse(str(json.dumps(json_response)))
dict = json.loads(json_response)
return HttpResponse(str(dict['fields']))
#return HttpResponse(str("foo"))
class LDAPView(View, SingleObjectMixin):
def get(self, request, *args, **kwargs):