Commit graph

319 commits

Author SHA1 Message Date
David Lord
066737d21c clean up preprocess_request docs
[ci skip]
2017-04-25 12:03:08 -07:00
David Lord
33335b4c28 Merge branch 'master' into AvivC-improve-docs-in-Flask.preprocess_request 2017-04-25 09:43:18 -07:00
David Lord
b54d8cfc5b refactor make_response to be easier to follow
* be explicit about how tuples are unpacked
* allow bytes for status value
* allow Headers for headers value
* use TypeError instead of ValueError
* errors are more descriptive
* document that view must not return None
* update documentation about return values
* test more response types
* test error messages

closes #1676
2017-04-25 08:30:48 -07:00
David Lord
e7bc408877 ensure error while opening session pops context
errors will be handled by the app error handlers
closes #1538, closes #1528
2017-04-22 13:57:04 -07:00
David Lord
3f10dd52c6 update changelog
move test next to existing test, rename
reword / reflow param doc
2017-04-21 07:26:30 -07:00
David Lord
3d22b81edf Merge branch 'master' into jrmccarthy-master 2017-04-21 07:03:46 -07:00
Sobolev Nikita
cce1d62fcf Fix typo in app.py (#2248) 2017-04-19 07:46:33 +02:00
jab
8a2db3db18 Change Flask.__init__ to accept two new keyword arguments, host_matching and static_host. (#1560)
This enables host_matching to be set properly by the time the constructor adds
the static route, and enables the static route to be properly associated with
the required host.

Previously, you could only enable host_matching once your app was already
instantiated (e.g. app.url_map.host_matching = True), but at that point
the constructor would have already added the static route without host matching
and an associated host, leaving the static route in a broken state.

Fixes #1559.
2017-04-07 16:31:54 +02:00
Markus Unterwaditzer
6b38678139 Merge branch '0.12-maintenance' 2017-03-31 18:44:33 +02:00
Markus Unterwaditzer
247a0c906d Revert "Handle BaseExceptions (#2222)"
This reverts commit 1d4448abe3.
2017-03-31 18:44:14 +02:00
Diggory Blake
d41d0803ef Handle BaseExceptions 2017-03-31 18:40:46 +02:00
Diggory Blake
2774221987 Handle BaseExceptions (#2222)
* Handle BaseExceptions

* Add test and changes

* Make test more idiomatic
2017-03-31 18:07:43 +02:00
John Bodley
0dae045fe7 Document run() host defaulting to SERVER_NAME 2017-03-11 18:59:34 +01:00
Hsiaoming Yang
9c5f048ad2 Don't rely on X-Requested-With for pretty print json response (#2193)
* Don't rely on X-Requested-With for pretty print json response

* Fix test cases for pretty print json patch

* Fix gramma error in docs for pretty print json config

* Add changelog for JSONIFY_PRETTYPRINT_REGULAR
2017-03-07 10:09:46 +09:00
Static
3eb41b7309 Fix typos/grammar in docs (#2201) 2017-03-06 14:05:59 +01:00
Armin Ronacher
02b5eadc43 Convert Flask.run into a noop when run from the CLI 2017-01-29 12:26:52 +01:00
Raphael Deem
eb6e8e40b2 use SERVER_NAME to set host and port in app.run() (#2152) 2017-01-17 13:22:16 -08:00
Martijn Pieters
3e0cb3d3be Remove busy-work. (#2072)
It is entirely sufficient to walk the MRO of the exception class, no need to check for classes re-appearing later on, no need to add the MRO of any superclass.

* Python refuses point-blank to create a class with a circular MRO.
* All classes in a superclass MRO *already* appear in the MRO of the derived type. Re-adding the contents of a superclass MRO is doing double work.
2016-11-01 07:35:17 -07:00
Clenimar Filemon
24e731e9ff Update docstring for errorhandler() (#2070) 2016-10-31 17:41:38 +01:00
小明
541f5439e0 Fix unbound error (#2039) 2016-09-25 18:25:54 +02:00
Pablo Marti
675805b2a4 Fix typo in docs
Also added one missing comma for readability
2016-09-12 08:41:09 +01:00
Armin Ronacher
c27c55be2f Merge pull request #2013 from pallets/bugfix/error-handler-error-handler
Corrected after response for error handlers
2016-09-10 03:36:29 +03:00
Akbar Ibrahim
d34d878095 Fixed error in errorhandler doc string. (#2014) 2016-09-08 17:34:51 +02:00
Armin Ronacher
a7fbfb387f Corrected after response for error handlers
Before this change after request functions were not correctly
invoked for error handlers.
2016-09-08 11:56:02 +03:00
Markus Unterwaditzer
ec9e9c2f6e Don't passthrough_errors unless instructed. (#2006)
Fix #2005

Revert #1679 and #1996
2016-09-06 22:32:34 +02:00
Afonso Queirós
e42c5b3d94 Correcting Custom Test Client class docs (#2004) 2016-09-05 16:57:00 +02:00
Josh Soref
0f2c793e14 Spelling (#1998)
* spelling: cacheability

* spelling: conceptually

* spelling: javascript

* spelling: reset

* spelling: raised

* comma: instead..., they...
2016-08-30 00:26:20 +02:00
Markus Unterwaditzer
2a5061282b Only passthrough_errors if PROPAGATE_EXCEPTIONS
See pallets/werkzeug#954
2016-08-27 14:38:13 +02:00
georgschoelly
7de93972bd fix docs: name of url_value_preprocessor method (#1932)
This typo got introduced in 5da1fc2215,
the original commit for the url_value_preprocessor decorator.
2016-06-26 13:32:47 -07:00
Markus Unterwaditzer
73246f4274 Revert "Addressing Issue 1809" 2016-06-14 22:45:24 +02:00
Armin Ronacher
3b98e39768 Implemented simplified CLI interface 2016-05-26 20:07:52 +02:00
ThiefMaster
e9e7e5e0c5 s/1.0/0.11/ in versionadded/versionchanged markers
closes #1817
2016-05-23 14:43:23 +02:00
Thomas Sanjurjo
b6a1091588 Addressing Issue 1809 (#1811)
document kwargs for Flask.register_blueprint
2016-05-22 07:09:21 -07:00
Jannis Leidel
9c4a73013c Forward ported CLI tests from Flask-CLI and fixed a bug with the CLI's name. (#1806)
* Forward port the CLI tests from Flask-CLI.

* Make sure the parameter passed to the CLI's AppGroup is the app's name, not the app itself.
2016-05-16 19:36:55 +02:00
Steven Loria
7d134e9556 Add JSONIFY_MIMETYPE configuration variable (#1728)
Allow jsonify responses' mimetype to be configured
2016-04-08 15:30:47 -07:00
Jeff Widman
0929ba6b9f Merge pull request #1577 from sprin/1102_warn_on_run
docs: run() should not be used in production
2016-04-04 11:22:34 -07:00
Steffen Prince
48443ee346 docs: run() should not be used in production
Refs #1102
2016-04-04 00:03:29 -05:00
lord63
dae1144daa Update app.py 2016-02-04 14:35:03 +08:00
lord63
0f904690da Fix typo
* Use the compatible way to handle the exception. You can find the
source code wsgi_app in app.py, and it use the compatible way, so update it
* Fix typo in config.py
* Fix typo in app.py
2016-02-03 21:08:22 +08:00
Aviv Cohn
d85a0c875f Clarified the docstring in method Flask.preprocess_request.
The doc now clearly states that the method invokes two set of hook
functions, and how these are filtered before execution.
2016-01-05 01:10:35 +02:00
Miguel Grinberg
2bbddf57f8 Werkzeug should not block propagated exceptions from Flask 2016-01-02 14:18:36 -08:00
lord63
7a13898bd2 Fix typo in app_ctx_globals_class doc in app.py 2015-11-07 09:04:24 +08:00
Timo Furrer
906e72b219 support timedelta for SEND_FILE_MAX_AGE_DEFAULT config variable 2015-10-24 07:04:23 +02:00
Armin Ronacher
da2634af9e Fixed some lint warnings 2015-10-02 23:19:54 +02:00
Jimmy McCarthy
588d351945 provide_automatic_options as explicit arg
In add_url_rule, break provide_automatic_options out to an explicit kwarg, and
add notes to the docstring.
2015-09-14 13:26:10 -05:00
Jimmy McCarthy
9ccdd2f796 Merge branch 'master' of github.com:mitsuhiko/flask 2015-09-14 13:06:54 -05:00
Markus Unterwaditzer
976db05a5b Merge branch '0.10-maintenance' 2015-07-16 12:05:07 +02:00
Christian Becker
5da31f8af3 fix UnboundLocalError in handle_url_build_error
- caused by changes in the execution model of python 3 where the alias of an except clause is cleared on exit of the except
2015-07-16 12:00:16 +02:00
Jimmy McCarthy
a3bbd155a3 Add kwarg to disable auto OPTIONS on add_url_rule
Adds support for a kwarg `provide_automatic_options` on `add_url_rule`, which
lets you turn off the automatic OPTIONS response on a per-URL basis even if
your view functions are functions, not classes (so you can't provide attrs
on them).
2015-07-07 13:20:53 -05:00
Alan Hamlett
a6f9582497 Enable autoescape for render_template_string 2015-07-04 23:41:43 +02:00