README.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Werkzeug
  2. ========
  3. *werkzeug* German noun: "tool". Etymology: *werk* ("work"), *zeug* ("stuff")
  4. Werkzeug is a comprehensive `WSGI`_ web application library. It began as
  5. a simple collection of various utilities for WSGI applications and has
  6. become one of the most advanced WSGI utility libraries.
  7. It includes:
  8. - An interactive debugger that allows inspecting stack traces and
  9. source code in the browser with an interactive interpreter for any
  10. frame in the stack.
  11. - A full-featured request object with objects to interact with
  12. headers, query args, form data, files, and cookies.
  13. - A response object that can wrap other WSGI applications and handle
  14. streaming data.
  15. - A routing system for matching URLs to endpoints and generating URLs
  16. for endpoints, with an extensible system for capturing variables
  17. from URLs.
  18. - HTTP utilities to handle entity tags, cache control, dates, user
  19. agents, cookies, files, and more.
  20. - A threaded WSGI server for use while developing applications
  21. locally.
  22. - A test client for simulating HTTP requests during testing without
  23. requiring running a server.
  24. Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
  25. to the developer to choose a template engine, database adapter, and even
  26. how to handle requests. It can be used to build all sorts of end user
  27. applications such as blogs, wikis, or bulletin boards.
  28. `Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
  29. providing more structure and patterns for defining powerful
  30. applications.
  31. Installing
  32. ----------
  33. Install and update using `pip`_:
  34. .. code-block:: text
  35. pip install -U Werkzeug
  36. A Simple Example
  37. ----------------
  38. .. code-block:: python
  39. from werkzeug.wrappers import Request, Response
  40. @Request.application
  41. def application(request):
  42. return Response('Hello, World!')
  43. if __name__ == '__main__':
  44. from werkzeug.serving import run_simple
  45. run_simple('localhost', 4000, application)
  46. Links
  47. -----
  48. - Website: https://palletsprojects.com/p/werkzeug/
  49. - Documentation: https://werkzeug.palletsprojects.com/
  50. - Releases: https://pypi.org/project/Werkzeug/
  51. - Code: https://github.com/pallets/werkzeug
  52. - Issue tracker: https://github.com/pallets/werkzeug/issues
  53. - Test status: https://dev.azure.com/pallets/werkzeug/_build
  54. - Official chat: https://discord.gg/t6rrQZH
  55. .. _WSGI: https://wsgi.readthedocs.io/en/latest/
  56. .. _Flask: https://www.palletsprojects.com/p/flask/
  57. .. _pip: https://pip.pypa.io/en/stable/quickstart/