def get(self): self.response.headers['Content-Type'] = 'text/html' # Список моделей names = {} for name in models.__all__: names[name] = getattr(__import__('models.' + name, fromlist = ['models']), name).__doc__ self.response.out.write(view.index(names))
def login(request): render_var = {'form': None, 'errormsg': ''} if 'username' in request.POST: username = request.POST.get('username', '') password = request.POST.get('password', '') if helpers.valid_login(request, username, password): if 'login_prev_url' in request.session: url = request.session['login_prev_url'] del request.session['login_prev_url'] return HttpResponseRedirect(url) else: return view.index(request) else: render_var['errormsg'] = 'Invalid username/password.' render_var['form'] = LoginForm() return render_to_response('stweb/login.html', render_var)
def do_POST(self): ctype, pdict = cgi.parse_header(self.headers['content-type']) if ctype == 'multipart/form-data': postvars = cgi.parse_multipart(self.rfile, pdict) elif ctype == 'application/x-www-form-urlencoded': length = int(self.headers['content-length']) postvars = parse_url_args(self.rfile.read(length)) else: postvars = {} SYNC_MODEL.send_command(postvars) self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(view.index())
def index(request): return view.index(request)
def handle_index_request(): return index()
def GET(self): print(session) return render.base(view.index(access_token=session.access_token, session=session))
def GET(self): return render.base(view.index())
def GET(self): return render.base(view.index(), "gestión vehicular y seguimiento satelital")
def GET(self): return view.index()