README.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 doesn't enforce any dependencies. It is up to the developer to
  25. choose a template engine, database adapter, and even how to handle
  26. requests. It can be used to build all sorts of end user applications
  27. 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. .. _WSGI: https://wsgi.readthedocs.io/en/latest/
  32. .. _Flask: https://www.palletsprojects.com/p/flask/
  33. Installing
  34. ----------
  35. Install and update using `pip`_:
  36. .. code-block:: text
  37. pip install -U Werkzeug
  38. .. _pip: https://pip.pypa.io/en/stable/getting-started/
  39. A Simple Example
  40. ----------------
  41. .. code-block:: python
  42. from werkzeug.wrappers import Request, Response
  43. @Request.application
  44. def application(request):
  45. return Response('Hello, World!')
  46. if __name__ == '__main__':
  47. from werkzeug.serving import run_simple
  48. run_simple('localhost', 4000, application)
  49. Donate
  50. ------
  51. The Pallets organization develops and supports Werkzeug and other
  52. popular packages. In order to grow the community of contributors and
  53. users, and allow the maintainers to devote more time to the projects,
  54. `please donate today`_.
  55. .. _please donate today: https://palletsprojects.com/donate
  56. Links
  57. -----
  58. - Documentation: https://werkzeug.palletsprojects.com/
  59. - Changes: https://werkzeug.palletsprojects.com/changes/
  60. - PyPI Releases: https://pypi.org/project/Werkzeug/
  61. - Source Code: https://github.com/pallets/werkzeug/
  62. - Issue Tracker: https://github.com/pallets/werkzeug/issues/
  63. - Website: https://palletsprojects.com/p/werkzeug/
  64. - Twitter: https://twitter.com/PalletsTeam
  65. - Chat: https://discord.gg/pallets