Commit a7ab1a11 authored by delanoe's avatar delanoe

[FIX] Django upgrade render context deprecated.

parent 0538321c
...@@ -2,7 +2,7 @@ from urllib.parse import urljoin ...@@ -2,7 +2,7 @@ from urllib.parse import urljoin
import json import json
import datetime import datetime
from django.shortcuts import render_to_response from django.shortcuts import render
from django.template import RequestContext from django.template import RequestContext
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
...@@ -25,12 +25,11 @@ def main(request, project_id, corpus_id, document_id, optional_focus_ngram): ...@@ -25,12 +25,11 @@ def main(request, project_id, corpus_id, document_id, optional_focus_ngram):
NB: url params are NOT used here (angular has its own url regex in app.js) NB: url params are NOT used here (angular has its own url regex in app.js)
""" """
return render_to_response('annotations/main.html', { context = { 'api_url' : urljoin(request.get_host(), '/annotations/')
# TODO use reverse() , 'garg_url' : request.get_host()
'api_url': urljoin(request.get_host(), '/annotations/'), , 'nodes_api_url': urljoin(request.get_host(), '/api/')
'garg_url': request.get_host(), }
'nodes_api_url': urljoin(request.get_host(), '/api/'), return render(request, 'annotations/main.html', context)
}, context_instance=RequestContext(request))
class NgramList(APIView): class NgramList(APIView):
"""Read the lists of ngrams (terms) that will become annotations""" """Read the lists of ngrams (terms) that will become annotations"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment