File: utils.rst

package info (click to toggle)
python-werkzeug 2.2.2-3%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,248 kB
  • sloc: python: 22,177; javascript: 304; makefile: 32; xml: 16; sh: 10
file content (74 lines) | stat: -rw-r--r-- 1,174 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
=========
Utilities
=========

Various utility functions shipped with Werkzeug.

.. module:: werkzeug.utils


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

.. autoclass:: cached_property
   :members:

.. autoclass:: environ_property

.. autoclass:: header_property

.. autofunction:: redirect

.. autofunction:: append_slash_redirect

.. autofunction:: send_file

.. autofunction:: import_string

.. autofunction:: find_modules

.. autofunction:: secure_filename


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

Please refer to :doc:`urls`.


User Agent API
==============

.. module:: werkzeug.user_agent

.. autoclass:: UserAgent
    :members:
    :member-order: bysource


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

.. module:: werkzeug.security

.. autofunction:: generate_password_hash

.. autofunction:: check_password_hash

.. autofunction:: safe_join


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.