Compare commits

...

11 Commits

Author SHA1 Message Date
Badhreesh 60dae2edf4
Merge 6e064b3ff2 into 2b42a803a2 2025-06-10 14:58:03 +08:00
David Lord 2b42a803a2
cleanup svg
pre-commit / main (push) Waiting to run Details
2025-06-09 21:20:36 -07:00
David Lord a7b67c99f9
svg logo (#5757)
pre-commit / main (push) Waiting to run Details
2025-06-09 14:33:26 -07:00
David Lord a758915893
svg logo 2025-06-09 14:31:31 -07:00
Badhreesh 6e064b3ff2
Fix typo 2025-05-22 12:56:14 +02:00
Badhreesh d4390442b7
Remove extra line 2025-05-22 12:52:54 +02:00
Badhreesh ac00a998a3 Remove extra wording 2025-05-22 12:52:11 +02:00
Badhreesh 5e3031e189 Move routing section back to original position 2025-05-22 12:51:00 +02:00
Badhreesh c8d80f690b Add reference to the request object section 2025-05-22 12:30:10 +02:00
Badhreesh d47ede1540 Demonstrate escaping without using path type 2025-05-22 12:22:49 +02:00
Badhreesh 0f2004c9e6 Initial commit 2025-05-21 20:35:11 +02:00
10 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,5 @@
<div align="center"><img src="https://raw.githubusercontent.com/pallets/flask/refs/heads/stable/docs/_static/flask-horizontal.svg" alt="" height="150"></div>
# Flask
Flask is a lightweight [WSGI] web application framework. It is designed

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

1
docs/_static/flask-horizontal.svg vendored Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.7 KiB

1
docs/_static/flask-icon.svg vendored Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M448.955,119.915c-0.579,59.76 13.398,192.715 18.542,238.988l-356.626,159.589c-23.367,-39.985 -40.836,-96.035 -51.551,-140.858l-2.503,1.065c-8.573,3.718 -16.932,2.18 -20.609,-3.664l-0.456,-0.734l-34.175,-62.778c-2.402,-4.381 -2.054,-10.547 1.006,-16.32c3.06,-5.777 8.827,-11.157 14.901,-13.815l409.395,-175.316c6.074,-2.657 12.451,-2.59 16.655,0.176c4.44,2.587 5.304,5.387 5.421,13.667Z" style="fill:#3babc3;fill-rule:nonzero;"/><path d="M477.297,411.517l-343.415,153.677c20.185,38.246 45.103,78.851 75.476,118.011l302.647,-154.214c-6.532,-16.924 -12.929,-35.311 -34.708,-117.474Z" style="fill:#3babc3;fill-rule:nonzero;"/><path d="M243.67,724.046l289.522,-147.543c30.054,59.626 66.144,102.294 104.553,132.415c86.929,68.257 183.958,71.364 241.412,65.146l-1.966,-9.7c-0.612,-3.136 0.28,-5.597 3.584,-6.859l30.59,-11.989c5.211,-2.017 10.611,-0.495 14.279,3.584l31.177,-12.015c4.981,-2.008 10.611,-0.494 14.233,3.564l24.268,37.075c11.806,16.723 -1.924,27.342 -6.368,29.035l-39.431,15.407c1.542,5.232 1.471,13.31 -9.022,17.288l-30.636,11.969c-9.584,3.739 -16.61,-2.411 -17.524,-8.292l-0.998,-5.224c-184.485,74.282 -330.818,70.194 -445.692,26.944c-82.561,-31.081 -149.05,-82.639 -201.981,-140.805Z" style="fill:#3babc3;fill-rule:nonzero;"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

1
docs/_static/flask-vertical.svg vendored Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -58,8 +58,8 @@ html_sidebars = {
}
singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]}
html_static_path = ["_static"]
html_favicon = "_static/shortcut-icon.png"
html_logo = "_static/flask-vertical.png"
html_favicon = "_static/flask-icon.svg"
html_logo = "_static/flask-vertical.svg"
html_title = f"Flask Documentation ({version})"
html_show_sourcelink = False

View File

@ -3,8 +3,9 @@
Welcome to Flask
================
.. image:: _static/flask-horizontal.png
.. image:: _static/flask-horizontal.svg
:align: center
:height: 200px
Welcome to Flask's documentation. Flask is a lightweight WSGI web application framework.
It is designed to make getting started quick and easy, with the ability to scale up to

View File

@ -139,19 +139,22 @@ how you're using untrusted data.
.. code-block:: python
from flask import request
from markupsafe import escape
@app.route("/<name>")
def hello(name):
@app.route("/hello")
def hello():
name = request.args.get("name", "")
return f"Hello, {escape(name)}!"
If a user managed to submit the name ``<script>alert("bad")</script>``,
User input can be submitted to the view function via the URL as query parameters,
like ``/hello?name=Bob``. Refer :ref:`the-request-object` for information on how
the query parameters are accessed.
If a user managed to submit ``/hello?name=<script>alert("bad")</script>``,
escaping causes it to be rendered as text, rather than running the
script in the user's browser.
``<name>`` in the route captures a value from the URL and passes it to
the view function. These variable rules are explained below.
Routing
-------
@ -504,6 +507,8 @@ The other possibility is passing a whole WSGI environment to the
with app.request_context(environ):
assert request.method == 'POST'
.. _the-request-object:
The Request Object
``````````````````