File: utils.rst

package info (click to toggle)
python-werkzeug 1.0.1%2Bdfsg1-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,888 kB
  • sloc: python: 21,897; javascript: 173; makefile: 36; xml: 16
file content (94 lines) | stat: -rw-r--r-- 1,466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
=========
Utilities
=========

Various utility functions shipped with Werkzeug.


HTML Helpers
============

.. module:: werkzeug.utils

.. autoclass:: HTMLBuilder

.. autofunction:: escape

.. autofunction:: unescape


General Helpers
===============

.. autoclass:: cached_property
   :members:

.. autofunction:: invalidate_cached_property

.. autoclass:: environ_property

.. autoclass:: header_property

.. autofunction:: redirect

.. autofunction:: append_slash_redirect

.. autofunction:: import_string

.. autofunction:: find_modules

.. autofunction:: validate_arguments

.. autofunction:: secure_filename

.. autofunction:: bind_arguments


URL Helpers
===========

Please refer to :doc:`urls`.

UserAgent Parsing
=================

.. module:: werkzeug.useragents

.. autoclass:: UserAgent
   :members:


Security Helpers
================

.. module:: werkzeug.security

.. versionadded:: 0.6.1

.. autofunction:: generate_password_hash

.. autofunction:: check_password_hash

.. autofunction:: safe_str_cmp

.. autofunction:: safe_join

.. autofunction:: pbkdf2_hex

.. autofunction:: pbkdf2_bin


Logging
=======

Werkzeug uses standard Python :mod:`logging`. The logger is named
``"werkzeug"``.

.. code-block:: python

    import logging
    logger = logging.getLogger("werkzeug")

If the logger level is not set, it will be set to :data:`~logging.INFO`
on first use. If there is no handler for that level, a
:class:`~logging.StreamHandler` is added.