You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.4 KiB

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