本文整理汇总了Python中werkzeug.Request.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Request.__init__方法的具体用法?Python Request.__init__怎么用?Python Request.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类werkzeug.Request
的用法示例。
在下文中一共展示了Request.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, environ, populate_request=True, shallow=False):
ResponseBase.__init__(self)
RequestBase.__init__(self, environ, populate_request, shallow)
self.href = Href(self.script_root or "/", self.charset)
self.abs_href = Href(self.url_root, self.charset)
self.headers = Headers([("Content-Type", "text/html")])
self.response = []
self.status_code = 200
示例2: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.context = {}
Request.__init__(self, *args, **kwargs)
# self.stream, self.form, self.files = parse_form_data(self.environ)
self.context.update(self.args.to_dict())
self.context.update(self.form.to_dict())
self.context.update(self.cookies)
self.context['request'] = self
示例3: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, environ):
RequestBase.__init__(self, environ)
before_request_init.emit()
self.url_adapter = url_map.bind_to_environ(self.environ)
self.match_exception = None
try:
self.endpoint, self.view_arguments = self.url_adapter.match()
except HTTPException, e:
self.endpoint = self.view_arguments = None
self.match_exception = e
示例4: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, environ):
RequestBase.__init__(self, environ)
before_request_init.emit()
self.url_adapter = url_map.bind_to_environ(self.environ)
self.view_lang = self.match_exception = None
try:
self.endpoint, self.view_arguments = self.url_adapter.match()
view_lang = self.view_arguments.pop('lang_code', None)
if view_lang is not None:
try:
self.view_lang = Locale.parse(view_lang)
if not has_section(self.view_lang):
raise UnknownLocaleError(str(self.view_lang))
except UnknownLocaleError:
self.view_lang = None
self.match_exception = NotFound()
except HTTPException, e:
self.endpoint = self.view_arguments = None
self.match_exception = e
示例5: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, environ):
RequestBase.__init__(self, environ)
self.endpoint = None
self.view_args = None
示例6: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, map_adapter, *args, **kwargs):
MapAdapterMixin.__init__(self, map_adapter)
WerkzeugRequest.__init__(self, *args, **kwargs)
示例7: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, *args, **kwargs):
BaseRequest.__init__(self, *args, **kwargs)
#: Logged database queries
self.queries = []
示例8: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, environ):
WerkzeugRequest.__init__(self, environ)
LoggerMixin.__init__(self)
local.request = self
示例9: __init__
# 需要导入模块: from werkzeug import Request [as 别名]
# 或者: from werkzeug.Request import __init__ [as 别名]
def __init__(self, app, environ):
wzRequest.__init__(self, environ)
self.app = app