def article_weightedtree_js(request): if request.method == "POST": data, referringSites = visualizer.article_weightedtree(request.POST.get("referringSite")) else: data, referringSites = visualizer.article_weightedtree(None) data = json.dumps(data) context = {"data": data, "referringSites": referringSites} return render(request, "visualizations/article_weightedtree_js.html", context)
def article_weightedtree_js(request): if not request.user.is_authenticated(): return redirect('/admin/login/?next=%s' % request.path) if request.method == 'POST': data, msites = visualizer.article_weightedtree(request.POST.get('msite')) else: data, msites = visualizer.article_weightedtree(None) data = json.dumps(data) context = {'data': data, 'msites': msites} return render(request, 'visualizations/article_weightedtree_js.html', context)