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
Provenance
- Commit
73b9bac- Tree
c54876c- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
36af821- Parent 2
ce6ad90
11 files changed+25 added−15 removed
modified:docs/deploying/index.rst-1 removed
64 unmodified lines65 interface. The links below are for some of the most common platforms,66 which have instructions for Flask, WSGI, or Python.67 68 - `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 linesmodified:docs/deploying/waitress.rst+2 added-2 removed
43 unmodified lines44 45 .. code-block:: text46 47 # equivalent to 'from hello import app'48- $ waitress-serve hello:app --host 127.0.0.148+ $ waitress-serve --host 127.0.0.1 hello:app49 50 # 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_app52 53 Serving on http://127.0.0.1:808054 55 The ``--host`` option binds the server to local ``127.0.0.1`` only.20 unmodified linesmodified:docs/patterns/javascript.rst+1 added-1 removed
26 unmodified lines27 It is important to understand the difference between templates and28 JavaScript. Templates are rendered on the server, before the response is29 sent to the user's browser. JavaScript runs in the user's browser, after30 the template is rendered and sent. Therefore, it is impossible to use31-JavaScript to affect how the Jinja template is rendered, but is is31+JavaScript to affect how the Jinja template is rendered, but it is32 possible to render data into the JavaScript that will run.33 34 To provide data to JavaScript when rendering the template, use the35 :func:`~jinja-filters.tojson` filter in a ``<script>`` block. This will224 unmodified linesmodified:docs/patterns/streaming.rst+1 added-1 removed
18 unmodified lines19 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"}24 25 Each ``yield`` expression is directly sent to the browser. Note though26 that some WSGI middlewares might break streaming, so be careful there in27 debug environments with profilers and other things you might have enabled.58 unmodified linesmodified:docs/tutorial/install.rst-1 removed
39 unmodified lines40 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 linesmodified:docs/extensiondev.rst+1 added-1 removed
182 unmodified lines183 context is active when a request context is, or when a CLI command is184 run. If you're storing something that should be closed, use185 :meth:`~flask.Flask.teardown_appcontext` to ensure that it gets closed186 when the application context ends. If it should only be valid during a187-request, or would not be used in the CLI outside a reqeust, use187+request, or would not be used in the CLI outside a request, use188 :meth:`~flask.Flask.teardown_request`.189 190 191 Views and Models113 unmodified linesmodified:docs/quickstart.rst+1 added-1 removed
39 unmodified lines40 itself.41 42 To run the application, use the ``flask`` command or43 ``python -m flask``. You need to tell the Flask where your application44-is with the ``-app`` option.44+is with the ``--app`` option.45 46 .. code-block:: text47 48 $ flask --app hello run859 unmodified linesmodified:docs/views.rst+8 added-3 removed
114 unmodified lines115 def dispatch_request(self, id)116 item = self.model.query.get_or_404(id)117 return render_template(self.template, item=item)118 119- 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+ )123 124 125 View Lifetime and ``self``126 --------------------------170 unmodified lines297 db.session.commit()298 return jsonify(item.to_json())299 300 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)305 306 register_api(app, User, "users")307 register_api(app, Story, "stories")308 16 unmodified linesmodified:src/flask/config.py+3 added-2 removed
273 unmodified lines274 275 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.280+281 :return: Always returns ``True``.282 283 .. versionadded:: 0.11284 """54 unmodified linesmodified:src/flask/globals.py+2 added-2 removed
86 unmodified lines87 if name == "_app_ctx_stack":88 import warnings89 90 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_stack1 unmodified line97 if name == "_request_ctx_stack":98 import warnings99 100 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_stack2 unmodified linesmodified:CHANGES.rst+6 added
2 unmodified lines3 4 Unreleased5 6 7+Version 2.2.38+-------------9+10+Unreleased11+12+13 Version 2.2.214 -------------15 16 Released 2022-08-081403 unmodified lines