web.py Session user authentication

Source: Internet
Author: User

Debugging a program that uses the session to authenticate the user is probably the same as the WEBPY session Certified sample program.

#!/usr/bin/env python#coding=utf-8import Webimport timeurls = ('/', ' Index ', '/xml ', ' pushxml ', '/login ', ' Login ', '/logout ', ' logout ',) render = Web.template.render (' templates/') web.config.debug = Falseapp = web.application (URLs, L        Ocals ()) session = Web.session.Session (app, Web.session.DiskStore (' Sessions ')) class index (): Def GET (self): Try:if session.logged_in = = True:return ' 

At the beginning, in order to facilitate web.config.debug = True (this is the default) the session is always unable to save after quite a long time the tangled find error actually out here

Web.config.debug = False

If you turn off the debug mode session can normally save the reason why I lost my virginity I didn't see http://webpy.org/cookbook/sessions today.

Sessions doesn ' t work on debug mode because it interfere with reloading. See Session_with_reloader for more details.

Fuck web.py!!!

web.py Session user authentication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.