Skip to content
Myr

Merge branch '2.2.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents 36af821, ce6ad90 · Browse files · 11 files+25 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

11 files+25 added−15 removed

  • other:+25 added−15 removed

11 files+25 added−15 removed

modified:docs/deploying/index.rst-1 removed
64 unmodified lines
65interface. The links below are for some of the most common platforms,66which have instructions for Flask, WSGI, or Python.6768- `PythonAnywhere <https://help.pythonanywhere.com/pages/Flask/>`_69- `Heroku <https://devcenter.heroku.com/articles/getting-started-with-python>`_69- `Google App Engine <https://cloud.google.com/appengine/docs/standard/python3/building-app>`_70- `Google Cloud Run <https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service>`_71- `AWS Elastic Beanstalk <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-flask.html>`_72- `Microsoft Azure <https://docs.microsoft.com/en-us/azure/app-service/quickstart-python>`_
7 unmodified lines
modified:docs/deploying/waitress.rst+2 added-2 removed
43 unmodified lines
4445.. code-block:: text4647 # equivalent to 'from hello import app'48 $ waitress-serve hello:app --host 127.0.0.148 $ waitress-serve --host 127.0.0.1 hello:app4950 # equivalent to 'from hello import create_app; create_app()'51 $ waitress-serve --call hello:create_app --host 127.0.0.151 $ waitress-serve --host 127.0.0.1 --call hello:create_app5253 Serving on http://127.0.0.1:80805455The ``--host`` option binds the server to local ``127.0.0.1`` only.
20 unmodified lines
modified:docs/patterns/javascript.rst+1 added-1 removed
26 unmodified lines
27It is important to understand the difference between templates and28JavaScript. Templates are rendered on the server, before the response is29sent to the user's browser. JavaScript runs in the user's browser, after30the template is rendered and sent. Therefore, it is impossible to use31JavaScript to affect how the Jinja template is rendered, but is is31JavaScript to affect how the Jinja template is rendered, but it is32possible to render data into the JavaScript that will run.3334To provide data to JavaScript when rendering the template, use the35:func:`~jinja-filters.tojson` filter in a ``<script>`` block. This will
224 unmodified lines
modified:docs/patterns/streaming.rst+1 added-1 removed
18 unmodified lines
19 def generate_large_csv():20 def generate():21 for row in iter_all_rows():22 yield f"{','.join(row)}\n"23 return generate(), {"Content-Type": "text/csv")23 return generate(), {"Content-Type": "text/csv"}2425Each ``yield`` expression is directly sent to the browser. Note though26that some WSGI middlewares might break streaming, so be careful there in27debug environments with profilers and other things you might have enabled.
58 unmodified lines
modified:docs/tutorial/install.rst-1 removed
39 unmodified lines
40 name='flaskr',41 version='1.0.0',42 packages=find_packages(),43 include_package_data=True,44 zip_safe=False,44 install_requires=[45 'flask',46 ],47 )
68 unmodified lines
modified:docs/extensiondev.rst+1 added-1 removed
182 unmodified lines
183context is active when a request context is, or when a CLI command is184run. If you're storing something that should be closed, use185:meth:`~flask.Flask.teardown_appcontext` to ensure that it gets closed186when the application context ends. If it should only be valid during a187request, or would not be used in the CLI outside a reqeust, use187request, or would not be used in the CLI outside a request, use188:meth:`~flask.Flask.teardown_request`.189190191Views and Models
113 unmodified lines
modified:docs/quickstart.rst+1 added-1 removed
39 unmodified lines
40itself.4142To run the application, use the ``flask`` command or43``python -m flask``. You need to tell the Flask where your application44is with the ``-app`` option.44is with the ``--app`` option.4546.. code-block:: text4748 $ flask --app hello run
859 unmodified lines
modified:docs/views.rst+8 added-3 removed
114 unmodified lines
115 def dispatch_request(self, id)116 item = self.model.query.get_or_404(id)117 return render_template(self.template, item=item)118119 app.add_url_rule("/users/<int:id>", view_func=DetailView.as_view("user_detail"))119 app.add_url_rule(120 "/users/<int:id>",121 view_func=DetailView.as_view("user_detail", User)122 )123124125View Lifetime and ``self``126--------------------------
170 unmodified lines
297 db.session.commit()298 return jsonify(item.to_json())299300 def register_api(app, model, url):301 item = ItemAPI.as_view(f"{name}-item", model)302 group = GroupAPI.as_view(f"{name}-group", model)298 app.add_url_rule(f"/{name}/<int:id>", view_func=ItemAPI(f"{name}-item", model))299 app.add_url_rule(f"/{name}/", view_func=GroupAPI(f"{name}-group", model))303 app.add_url_rule(f"/{name}/<int:id>", view_func=item)304 app.add_url_rule(f"/{name}/", view_func=group)305306 register_api(app, User, "users")307 register_api(app, Story, "stories")308
16 unmodified lines
modified:src/flask/config.py+3 added-2 removed
273 unmodified lines
274275 def from_mapping(276 self, mapping: t.Optional[t.Mapping[str, t.Any]] = None, **kwargs: t.Any277 ) -> bool:278 """Updates the config like :meth:`update` ignoring items with non-upper279 keys.278 """Updates the config like :meth:`update` ignoring items with279 non-upper keys.280281 :return: Always returns ``True``.282283 .. versionadded:: 0.11284 """
54 unmodified lines
modified:src/flask/globals.py+2 added-2 removed
86 unmodified lines
87 if name == "_app_ctx_stack":88 import warnings8990 warnings.warn(91 "'_app_ctx_stack' is deprecated and will be remoevd in Flask 2.3.",91 "'_app_ctx_stack' is deprecated and will be removed in Flask 2.3.",92 DeprecationWarning,93 stacklevel=2,94 )95 return __app_ctx_stack
1 unmodified line
97 if name == "_request_ctx_stack":98 import warnings99100 warnings.warn(101 "'_request_ctx_stack' is deprecated and will be remoevd in Flask 2.3.",101 "'_request_ctx_stack' is deprecated and will be removed in Flask 2.3.",102 DeprecationWarning,103 stacklevel=2,104 )105 return __request_ctx_stack
2 unmodified lines
modified:CHANGES.rst+6 added
2 unmodified lines
34Unreleased567Version 2.2.38-------------910Unreleased111213Version 2.2.214-------------1516Released 2022-08-08
1403 unmodified lines