def setting(request): context = kvs() # print(context) if not session_valid(request): return script('location.href="http://" + location.host + "/login"') return render(request, "mng/setting.html", context)
def download(request): docs = all_files() context = {'docs': docs} if not session_valid(request): return script('location.href="http://" + location.host + "/login"') return render(request, 'mng/download.html', context)
def publish(request): context = {} if not session_valid(request): return script('location.href="http://" + location.host + "/login"') return render(request, 'mng/publish.html', context)
def key_valid(request): if request.POST['key'] == '*****@*****.**': request.session['legal'] = True return script('location.href="http://" + location.host') else: return login(request)
def need_login(request): if not session_valid(request): return script('location.href="http://" + location.host + "/login"')
def view(request, year, month, day): context = query_when(year, month, day) if not session_valid(request): return script('location.href="http://" + location.host + "/login"') return render(request, 'mng/view.html', context)
def export_html(request): if not session_valid(request): return script('location.href="http://" + location.host + "/login"') return render(request, 'mng/export.html', {})