Commit Graph

1692 Commits

Author SHA1 Message Date
rayanth 95b666871c
Update api.rst
Corrected typo in "tojson" example, `const names = {{ names|tojson }};` was `const names = {{ names|tosjon }};`
2022-12-13 13:27:38 -08:00
David Lord b5ec83b697
Merge pull request #4882 from Abdur-rahmaanJ/patch-4
Fix backtick not rendering.
2022-11-27 06:51:08 -08:00
Dosenpfand 9a294a6401 Fix class-based views example 2022-11-27 13:10:14 +01:00
Abdur-Rahmaan Janhangeer d951a763fb
Fix backstick not rendering. 2022-11-27 13:51:09 +04:00
David Lord 066a35dd32
Merge branch '2.2.x' 2022-11-25 07:51:37 -08:00
Jonah Lawrence cc66213e57
Add .svg to select_jinja_autoescape (#4840)
As SVG files are a type of XML file and are similar in nearly 
all aspects to XML, .svg should also be autoescaped.
2022-10-30 14:55:51 +00:00
Mat Steininger 5dfd2126a6 Fixed inconsistent double spacing in docs/api.rst 2022-10-30 22:45:33 +08:00
David Lord 3dc6db9d0c
Merge pull request #4835 from TehBrian/2.2.x
fix typo in quickstart
2022-10-04 20:09:06 -07:00
TehBrian 75e92090ee
fix typo in quickstart 2022-10-04 21:12:13 -04:00
Maksim Salau 9c3deeee96
Fix argument in `register_api()` in docs/view.rst (#4818) 2022-09-14 06:08:38 -07:00
waffle-stomper 2c78771238
Fix missing assignment in MethodView example (#4815) 2022-09-14 06:07:20 -07:00
David Lord ce6ad90ecf
remove heroku link 2022-08-27 06:03:46 -07:00
Kevin Kirsche 00bdc2b448
fix: remove obsolete `zip_safe` (#4783)
remove obsolete `zip_safe`
2022-08-22 09:05:52 -07:00
Dillon Barnes 86bf3f205f
Correct `waitress-serve` command 2022-08-17 17:00:25 +01:00
David Lord 2d3f72574d
fix typo 2022-08-15 12:37:11 -07:00
David Lord d94634b1be
fix view docs 2022-08-15 07:34:50 -07:00
David Lord 1d07857b1d
fix typo 2022-08-15 07:29:34 -07:00
Oğuzhan Çelikarslan 77cdefccee Fix typo 2022-08-13 10:08:11 +08:00
tautv 22b6296830
Update javascript.rst
Spelling
2022-08-09 09:45:02 +01:00
David Lord a0458efef6
refactor or remove old docs (#4748) 2022-08-05 11:28:22 -07:00
David Lord bfdd37110c
deprecate config attributes 2022-08-01 16:58:55 -07:00
David Lord 30427a2090
remove FLASK_ENV from docs 2022-08-01 15:11:35 -07:00
David Lord 4c08e3a2ba
update pycharm instructions 2022-08-01 11:39:31 -07:00
David Lord 5d8e35653f
refactor lazy loading
Remove the `--eager-loading/--lazy-loading` options and the
`DispatchingApp` middleware. The `run` command handles loading
exceptions directly. The reloader always prints out tracebacks
immediately and always defers raising the error.
2022-08-01 10:34:13 -07:00
David Lord 02a0851252
Merge branch '2.1.x' 2022-07-24 19:37:30 -07:00
David Lord 2869ddf50c
update blinker intersphinx link 2022-07-24 19:35:28 -07:00
David Lord 48fe96588c
Merge branch '2.1.x' 2022-07-13 13:58:07 -07:00
David Lord 69f9845ef2
add json provider interface 2022-07-13 07:42:52 -07:00
David Lord e0dad45481
update docs about contexts 2022-07-08 11:13:09 -07:00
Earl C. Ruby III 6751f68560
New URL for the Quart project
The Quart project moved from Gitlab (https://gitlab.com/pgjones/quart) to Github (https://github.com/pallets/quart). There is a message at the top of the Gitlab page announcing the move.
2022-07-08 10:21:42 -07:00
Ties Jan Hefting 9dfcb90c92
Document serialization of Decimal in JSONEncoder
The Flask JSONEncoder serializes Decimal types to strings, but this
behavior is missing from the docs. The docs are updated accordingly.
2022-07-06 11:47:50 +02:00
David Lord f8cb0b0dd5
update docs about json 2022-07-02 21:41:37 -07:00
David Lord 96d39c87a8
Merge remote-tracking branch 'origin/2.1.x' 2022-07-01 13:32:50 -07:00
David Lord 84c722044a
new debug/test preserve context implementation 2022-07-01 12:01:44 -07:00
David Lord b46bfcfa63
rewrite extension development docs 2022-06-28 16:28:33 -07:00
hankhank10 64ab59817d
show separate HTTP method route decorators in quickstart 2022-06-28 06:24:46 -07:00
hankhank10 abcb6c9677
Update javascript.rst 2022-06-23 05:54:56 -07:00
pgjones 46433e9807
add generate_template and generate_template_string functions 2022-06-18 12:20:53 -07:00
David Lord c9e000b9ce
with_appcontext lasts for the lifetime of the click context 2022-06-17 11:52:01 -07:00
David Lord ab1fbef29a
prefer --app over FLASK_APP in docs 2022-06-17 09:26:26 -07:00
David Lord 9c50b8fc1c
fix formatting 2022-06-13 06:08:45 -07:00
David Lord 97298e06fe
Merge branch '2.1.x' 2022-06-12 16:04:01 -07:00
David Lord a9878c018b
remove mod_wsgi-standalone 2022-06-12 16:03:51 -07:00
David Lord 9139af1c62
Merge branch '2.1.x' 2022-06-12 14:10:51 -07:00
David Lord 2ea77c2782
rewrite deployment docs 2022-06-12 14:00:00 -07:00
David Lord dcd1a1e0b6
Merge branch '2.1.x' 2022-06-11 14:16:51 -07:00
David Lord 2f3c87dcb8
rewrite javascript docs 2022-06-11 13:44:46 -07:00
David Lord bab5a65e6e
rewrite class-based view docs 2022-06-06 15:33:46 -07:00
Nick Kocharhook 5d31ce1031
Fix incorrect references to query in testing doc
The [EnvironBuilder doc](https://werkzeug.palletsprojects.com/en/2.1.x/test/#werkzeug.test.EnvironBuilder) shows that the correct name for the keyword argument is `query_string`, not `query`. Using `query` results in an error.

I've fixed the two places this appears in the testing doc.
2022-06-01 12:16:21 -07:00
Nathan Brown c45c81938a
Add link to additional packaging info 2022-05-23 10:42:51 -07:00
lecovi 9252be9c9e
docs: new configuration format for celery 2022-05-23 10:16:45 -07:00
David Lord 2381044d04
remove references to mailing list 2022-05-10 09:28:43 -07:00
Luis Palacios 410a324ec4
remove becomingbig.rst 2022-05-10 09:16:44 -07:00
David Lord 11195f1083
remove outdated dotenv docs
The CLI does not change the working directory when loading a dotenv file.
2022-05-04 06:03:31 -07:00
Bo Bayles 3fd24c1f6f Fix copy/paste error in wsgi-standalone.rst 2022-04-25 10:55:30 -05:00
MeViMo 4dd14ed039 Syntax error in testing.rst 2022-04-13 18:49:51 +02:00
MeViMo 19d7a0ef78
docs pass cli args as kwarg to test runner 2022-04-08 11:03:06 -07:00
LarsMoons e3c014f9aa
docs "Returning API Errors as JSON" return correct status code 2022-04-08 10:57:02 -07:00
David Lord e75d575361
windows env vars are uppercase 2022-03-25 12:07:45 -07:00
David Lord 4eb5e9455b
more from_prefixed_env features
* support nested dict access with "__" separator
* don't specify separator in prefix
* catch exceptions for any loads function
2022-03-25 11:54:45 -07:00
pgjones 08a283af5e
Allow loading of environment variables into the config
This new method will pick out any environment variables with a certain
prefix and place them into the config named without the prefix. This
makes it easy to use environment variables to configure the app as is
now more popular than when Flask started.

The prefix should ensure that the environment isn't polluted and the
config isn't polluted by environment variables.

I've followed the dynaconf convention of trying to parse the
environment variable and then falling back to the raw value if parsing
fails.
2022-03-25 11:54:03 -07:00
David Lord 81c7ff7f8d
update tests for relative redirects 2022-03-25 11:48:26 -07:00
octopoulpe d80f41f57d
Update errorhandling.rst 2022-03-22 10:29:00 +01:00
David Lord b6a8ccd2cf
Merge branch '2.0.x' 2022-02-14 12:06:57 -08:00
David Lord 761d7e1652
rewrite testing docs 2022-02-13 14:06:51 -08:00
Mickaël Guérin beae1249f7
add `exclude-patterns` option to `flask run` 2022-02-09 12:44:03 -08:00
David Lord e37e87140e
Merge branch '2.0.x' 2022-02-09 07:37:43 -08:00
Cameron Dahl 08ad8aabfe
Remove X-XSS-Protection suggestion 2022-01-14 08:32:36 -08:00
otherJL0 afe77feef3
Adding Fish commands to docs 2022-01-14 08:26:50 -08:00
David Lord 0fb5c2f034
Merge branch '2.0.x' 2021-12-22 20:02:52 -07:00
Grey Li 0122a4f34f
Fix the command for checking port on macOS in server docs 2021-12-22 18:59:28 -07:00
David Lord edac7e3a56
Merge branch '2.0.x' 2021-12-22 15:21:31 -08:00
Jürgen Gmach f16524ea1d
fix typo 2021-12-16 04:28:09 +01:00
David Lord 2e10fc24a1
document address already in use error 2021-11-16 09:04:18 -08:00
David Lord 9fe21310bb
replace nbsp characters 2021-11-16 08:34:55 -08:00
David Lord ea66c68553
Merge branch '2.0.x' 2021-11-15 13:26:06 -08:00
David Lord b7501776a1
remove deprecated safe_join 2021-11-12 09:52:16 -08:00
David Lord df806c8035
update docs about gevent/eventlet/greenlet 2021-11-11 18:32:07 -08:00
David Lord 1b552d0b01
remove ContextVar compat 2021-11-11 16:12:08 -08:00
David Lord e609dddd60
drop Python 3.6 2021-11-11 16:11:43 -08:00
Chenwei Xiao a2e79eefc9 Correct the actual unescaped character
`»` should be unescaped to `»` after `striptags`.

Ref: https://flask.palletsprojects.com/en/2.0.x/api/#flask.Markup.striptags
2021-11-07 10:40:52 +08:00
Ryan Nevius 225ff3ea6c Fix example `SECRET_KEY` generation code
Removes the extra `)` in: `print(secrets.token_hex())`
2021-10-18 10:41:39 +02:00
karintou8710 21def4e05c Fixes old print statement in some documentation pages 2021-10-16 02:04:07 +09:00
Kevin Kirsche 58a08a1d73
use secrets instead of os.urandom 2021-10-13 08:12:51 -07:00
Seth Rutner 1a40d9b976
fix grammar in links to app and request context 2021-10-01 10:16:20 -07:00
Kasper Primdal Lauritzen 3a78f501e9
Fix broken link to Flask-WTF 2021-10-01 09:57:25 -07:00
Kevin Kirsche 9d9108fe25
fix: typo docs/debugging.rst:72
docs/debugging.rst:72: controled ==> controlled
2021-09-14 12:29:42 -04:00
Mindiell e1dce5c39a
Fix typo in docs (#4261) 2021-09-08 10:00:36 +02:00
nabbisen fafc132dcb
Update cherokee links in docs/deploying (#4249) 2021-08-29 09:21:36 -04:00
Grey Li 84aa8706c0
Remove the mention of Flask-Uploads in uploading docs 2021-08-14 05:10:45 -07:00
Angeline 5119657547
safer check for existing user in tutorial
Co-authored-by: David Lord <davidism@gmail.com>
2021-08-05 18:01:55 -07:00
David Lord a0afb6f375
Merge pull request #4190 from yuxiaoy1/docs
Improve code example of api & jQuery docs
2021-08-05 16:55:51 -07:00
kaushik kothiya 858cc9cace
Wrong variable name use
File upload section upload_file function in  file request parameter variable name is "file". but file save method in secure_filename function in use "f.filename".
2021-08-05 08:52:42 -07:00
Elahi-cs 3127c304ec Small SQL formatting fix 2021-07-07 19:41:11 +02:00
Frank Yu 85c35bd615
Fix link in ASGI docs (#4191)
* Fix link in ASGI docs

* Improve the wording of ASGI docs

Co-authored-by: Grey Li <withlihui@gmail.com>
2021-07-07 19:26:24 +08:00
Frank Yu 29c09a92c4
Omit the type attribute of script tag 2021-07-07 15:18:04 +08:00
Frank Yu 922e91b278
Omit the type attribute of script tag 2021-07-07 15:16:29 +08:00
Grey Li c224832acc Fix typo in docs/views.rst 2021-06-26 22:15:43 +08:00
Frank Yu 35eb582bf3
Change flask.xxx to plain version in testing docs 2021-06-20 23:20:14 +08:00
David Lord d426b58e57
Merge pull request #4155 from yuxiaoy1/patch-1
Fix bad link in templating docs
2021-06-20 06:45:54 -07:00
Frank Yu 7b696e076a
Update testing.rst 2021-06-18 22:18:15 +08:00
Frank Yu 5fa7d2efe7
Update templating.rst 2021-06-18 20:15:02 +08:00
Frank Yu f353d126d1
Update docs of rendering templates (#4153)
* Update docs of rendering templates

* Improve the grammar

Co-authored-by: Grey Li <withlihui@gmail.com>
2021-06-18 10:10:29 +08:00
Hugo Montenegro 92bed66194
Update celery.rst
small typo
2021-06-08 19:01:07 +02:00
Miguel Grinberg 270eb2df2a Support View and MethodView instances with async handlers 2021-06-01 18:08:19 +00:00
laggardkernel 0ce270d1f3 Update doc about minimal Python version for async support 2021-05-30 11:03:49 +00:00
Grey Li aa6fbf2f5a Fix typo in docs/tutorial/index.rst 2021-05-24 16:33:02 +08:00
Grey Li a541c2ac8b Fix view decorators docs 2021-05-21 12:11:03 +00:00
David Lord cfda270899
update pallets-sphinx-themes 2021-05-20 21:03:02 -07:00
Rafael Aviles 9c186ccfe8 Use escape function in return statement for username and subpath. 2021-05-14 13:23:34 -07:00
Andrew J Roth 2889ea4dd9
Added Google Cloud Run as a Hosted option 2021-05-12 09:14:34 -04:00
Grey Li 57b19fda54 Fix typo in the example of nesting bp docs 2021-05-12 07:49:34 +00:00
David Lord 52adf2ec21
rename default branch in files 2021-05-11 15:18:41 -07:00
Grey Li 531671c9c5
Improve the wording of using FLASK_APP 2021-05-10 22:58:19 -07:00
David Lord 79ac96f123
show type hints in description 2021-05-10 22:45:42 -07:00
pgjones 7f87f3dd93
Simplify the async handling code
Firstly `run_sync` was a misleading name as it didn't run anything,
instead I think `async_to_sync` is much clearer as it converts a
coroutine function to a function. (Name stolen from asgiref).

Secondly trying to run the ensure_sync during registration made the
code more complex and brittle, e.g. the _flask_async_wrapper
usage. This was done to pay any setup costs during registration rather
than runtime, however this only saved a iscoroutne check. It allows
the weirdness of the Blueprint and Scaffold ensure_sync methods to be
removed.

Switching to runtime ensure_sync usage provides a method for
extensions to also support async, as now documented.
2021-05-03 06:15:39 -07:00
Joshua Bronson 8bfce88e39
Minor docs fixes. (#3988) 2021-05-02 16:05:08 -04:00
Grey Li ec044a24e1 Add tips for using async on Windows on Python 3.8 2021-04-29 10:59:26 +08:00
David Lord 03db9194d8
Merge pull request #3967 from pgjones/docs 2021-04-17 07:34:56 -07:00
pgjones f74cce164e Update documentation on asyncio background tasks
This has been an early question from users, so best to explain.
2021-04-17 15:13:33 +01:00
pgjones 1c3b53c5db Update the docs on serving with ASGI
Whilst it has been possible to serve via an ASGI server for a while
(using WSGI to ASGI middleware/adapters) it hasn't added much. Now
though it makes sense to recommend the asgiref adapter as it
integrates with the same event loop used for async route handlers
etc...
2021-04-17 11:30:22 +01:00
David Lord 6f09b4b5ed
Merge remote-tracking branch 'origin/1.1.x' into release-2.0.0rc1 2021-04-16 08:37:56 -07:00
pgjones f92e820b4b
Nested blueprints
This allows blueprints to be nested within blueprints via a new
Blueprint.register_blueprint method. This should provide a use case
that has been desired for the past ~10 years.

This works by setting the endpoint name to be the blueprint names,
from parent to child delimeted by "." and then iterating over the
blueprint names in reverse order in the app (from most specific to
most general). This means that the expectation of nesting a blueprint
within a nested blueprint is met.
2021-04-14 09:25:42 -07:00
David Lord dc3e9c0cc3
update async docs 2021-04-06 15:33:06 -07:00
pgjones 6979265fa6
Add `async` support
This allows for async functions to be passed to the Flask class
instance, for example as a view function,

    @app.route("/")
    async def index():
        return "Async hello"

this comes with a cost though of poorer performance than using the
sync equivalent.

asgiref is the standard way to run async code within a sync context,
and is used in Django making it a safe and sane choice for this.
2021-04-06 09:35:10 -07:00
kangetsu121 6eeaa2e50d fix a broken link 2021-03-16 16:30:54 +00:00
David Lord dcd3b5c8f8
Merge pull request #3922 from pallets/consistency
various cleanup for consistency between projects
2021-02-24 10:35:16 -08:00
David Lord 9e7d3a6b69
docs rename changelog to changes 2021-02-24 10:09:38 -08:00
David Lord 3cd615a1d6
update project links 2021-02-24 10:09:15 -08:00
Grey Li 76abbe9062 Remove the mention of Flask-OAuth in the extension dev docs 2021-02-19 22:59:09 +08:00
David Lord b473e7c97c
use Jinja's tojson filter 2021-02-01 22:48:09 -08:00
Tony De La Nuez 451c1f87f3
got_request_exception only sends unhandled exceptions
Co-authored-by: David Lord <davidism@gmail.com>
2021-02-01 20:28:10 -08:00
David Lord 64206c13c2
simplify InternalServerError.original_exception 2021-01-29 11:26:17 -08:00
David Lord 1936ca8a2e
remove BaseRequest and BaseResponse 2021-01-29 10:52:48 -08:00
David Lord fdba0d2526
remove JSONMixin 2021-01-29 10:52:48 -08:00
Elliott King 7068d0983a
Clarify json error handling 2021-01-27 12:08:02 -05:00
Grey Li de0af03862 Merge remote-tracking branch 'origin/1.1.x' 2020-12-30 21:00:49 +08:00
jordivandooren 7d3ae48d57
fix explanation of wheel name (#3848)
* fix explanation of wheel name

* Improve the description of wheel filename format

Co-authored-by: Grey Li <withlihui@gmail.com>
2020-12-30 18:57:37 +08:00
David Lord dc11cdb4a4
move send_file and send_from_directory to Werkzeug
The implementations were moved to Werkzeug, Flask's functions become
wrappers around Werkzeug to pass some Flask-specific values.

cache_timeout is renamed to max_age. SEND_FILE_MAX_AGE_DEFAULT,
app.send_file_max_age_default, and app.get_send_file_max_age defaults
to None. This tells the browser to use conditional requests rather than
a 12 hour cache.

attachment_filename is renamed to download_name, and is always sent if
a name is known.

Deprecate helpers.safe_join in favor of werkzeug.utils.safe_join.

Removed most of the send_file tests, they're tested in Werkzeug.

In the file upload example, renamed the uploaded_file view to
download_file to avoid a common source of confusion.
2020-11-05 09:27:52 -08:00
David Lord 15a49e7297
Merge branch '1.1.x' 2020-11-04 18:25:37 -08:00
Sarthak Vineet Kumar 577eec198a
updated doc for mod_wsgi (#3751)
Co-authored-by: Sarthak <sarthak@MacBook.local>
2020-11-04 18:20:36 -08:00
Viet Hung Nguyen 7c20611cdd
mkstemp returns a file descriptor (#3809) 2020-10-31 20:09:57 -07:00
Bart Broere 070a0c1c75
removing outdated xhtml information (#3802) 2020-10-21 14:13:41 -07:00
Grey Li 1035efc7d6
Add command switch tabs for Bash, CMD and Powershell with sphinx-tabs (#3714)
* Enable Sphinx extension sphinx-tabs

* Add command tabs for all export commands

* Add command tabs for all venv commands

Fix trim spaces
2020-10-15 14:08:37 -07:00
Jamiu Salimon 9d824db41c
Update the signature of the teardown function (#3730)
Co-authored-by: David Lord <davidism@gmail.com>
2020-10-15 14:02:54 -07:00
Henry Kobin fa5aebc842
updated Sentry link (#3788) 2020-10-11 19:15:19 -07:00
sblondon 7e312c421e
aesthetic: add a space after a comma (#3771) 2020-09-28 07:21:13 -07:00
miquelvir 598c56c498
fix grammar (#3769) 2020-09-28 06:21:59 -07:00
Ebram Shehata 12a4d15546
Update quickstart.rst (#3767) 2020-09-25 16:52:00 -07:00
girst de464c03e1
Correct Sentry advertisement (not Free Software) (#3758) 2020-09-15 09:20:10 -07:00