コード例 #1
0
ファイル: views.py プロジェクト: igorlifar/debt-manager
def index(request):
	
	if request.user.is_anonymous():
		return redirect("/login/")
	
	section = get_section(request)
	context = get_context(section, request)
	
	return render(section, context, request)
コード例 #2
0
ファイル: handlers.py プロジェクト: allocator64/sct-example
def get_page_part(request):
	
	req = json.loads(request.raw_post_data)
	h_section = get_html_section(req['path'], request)
	h_context = get_context(h_section, request)
		
	j_section = get_js_section('scripts/' + h_context['js'], request)
	
	h_template = req['template']
	
	response = {}
	response["html"] = render_html_template(section = h_section, context = h_context, request = request, template = h_template)
	
	try:
		response["js"] = render_js_template(section = j_section, context = {}, request = request, template = h_template[:-5] + '.js')
	except:
		response['js'] = ''
		
	return HttpResponse(json.dumps(response))	
コード例 #3
0
ファイル: views.py プロジェクト: allocator64/sct-example
def index(request):
	section = get_section(request)
	context = get_context(section, request)
	
	return render(section, context, request)