Skip to content

Commit

Permalink
docs: some flask issues (#3929)
Browse files Browse the repository at this point in the history
  • Loading branch information
euri10 authored Jan 10, 2025
1 parent c34403f commit 21efdbb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/migration/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ Request methods
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.environ`` | ``request.scope`` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.files`` | Use ```UploadFile`` <usage/requests/file-uploads>`__ |
| ``request.files`` | Use ``UploadFile`` see in :doc:`/usage/requests` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.form`` | ``request.form()``, prefer ```Body`` <usage/requests/content-type>`__ |
| ``request.form`` | ``request.form()``, prefer ``Body`` see in :doc:`/usage/requests` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.get_json`` | ``request.json()``, prefer the ```data keyword argument`` <usage/requests/request-body>`__ |
| ``request.get_json`` | ``request.json()``, prefer the ``data`` keyword argument, see in :doc:`/usage/requests` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.headers`` | ``request.headers`` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -276,11 +276,11 @@ in Litestar.
.. code-block:: python
from litestar import Litestar
from litestar.static_files import StaticFilesConfig
from litestar.static_files import create_static_files_router
app = Litestar(
[], static_files_config=[StaticFilesConfig(path="/static", directories=["static"])]
)
app = Litestar route_handlers=[
create_static_files_router(path="/static", directories=["assets"]),
])
.. seealso::

Expand Down Expand Up @@ -447,7 +447,7 @@ For redirects, instead of ``redirect`` use ``Redirect``:
@get("/hello")
def hello() -> Redirect:
return Redirect(path="index")
return Redirect(path="/")
app = Litestar([index, hello])
Expand Down

0 comments on commit 21efdbb

Please sign in to comment.