Tornado 6.5 Documentation
application for a complete example that uses authentication (and stores user data in a PostgreSQL database). Third party authentication The tornado.auth module implements the authentication and authorization initialize(). Example: class ProfileHandler(RequestHandler): def initialize(self, database): self.database = database def get(self, username): (continues on next page) 6.2. Web framework 41Tornado (continued from previous page) ... app = Application([ (r'/user/(.*)', ProfileHandler, dict(database=database)), ]) RequestHandler.prepare() → Awaitable[None] | None Called at the beginning of a request0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
mos/blog] for a complete example that uses authentication (and stores user data in a PostgreSQL database). Third party authentication The tornado.auth module implements the authentication and authorization initialize(self, database): self.database = database def get(self, username): ... app = Application([ (r'/user/(.*)', ProfileHandler, dict(database=database)), ]) RequestHandler get_user_locale, which you can override to set the locale based on, e.g., a user preference stored in a database, or get_browser_locale, which uses the Accept-Language header. RequestHandler.log_exception(typ:0 码力 | 437 页 | 405.14 KB | 2 月前3
共 2 条
- 1
相关搜索词