Skip to content
Myr

Merge branch 'master' into module-support

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

authored by Armin Ronacher · committed by Armin Ronacher · parents c0a9f5d, ef34638 · Browse files · 4 files+42 added−10 removed
This commit

State

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

Diff stats

4 files+42 added−10 removed

  • tests:+14 added−0 removed
  • other:+28 added−10 removed

4 files+42 added−10 removed

modified:docs/tutorial/setup.rst+4 added-9 removed
55 unmodified lines
56without problems. When you head over to the server you will get an 40457page not found error because we don't have any views yet. But we will58focus on that a little later. First we should get the database working.5960.. admonition:: Troubleshooting60.. admonition:: Externally Visible Server6162 If you notice later that the browser cannot connect to the server63 during development, you might want to try this line instead::6465 app.run(host='127.0.0.1')6667 In a nutshell: Werkzeug starts up as IPv6 on many operating systems by68 default and not every browser is happy with that. This forces IPv469 usage.62 Want your server to be publically available? Check out the63 :ref:`externally visible server <public-server>` section for more64 information.
modified:docs/quickstart.rst+18 added
52 unmodified lines
53 the Python interpreter and not used as imported module.5455To stop the server, hit control-C.5657.. _public-server:5859.. admonition:: Externally Visible Server6061 If you run the server you will notice that the server is only available62 from your own computer, not from any other in the network. This is the63 default because in debugging mode a user of the application can execute64 arbitrary Python code on your computer. If you have `debug` disabled65 or trust the users on your network, you can make the server publicly66 available.6768 Just change the call of the :meth:`~flask.Flask.run` method to look69 like this::7071 app.run(host='0.0.0.0')7273 This tells your operating system to listen on a public IP.747576Debug Mode77----------7879Now that :meth:`~flask.Flask.run` method is nice to start a local
557 unmodified lines
modified:tests/flask_tests.py+14 added
13 unmodified lines
14import sys15import flask16import unittest17import tempfile18import warnings192021example_path = os.path.join(os.path.dirname(__file__), '..', 'examples')22sys.path.append(os.path.join(example_path, 'flaskr'))
201 unmodified lines
224 with app.test_request_context():225 assert flask.url_for('static', filename='index.html') \226 == '/static/index.html'227228 def test_none_response(self):229 warnings.filterwarnings('error', 'View function did not return')230 app = flask.Flask(__name__)231 @app.route('/')232 def test():233 return None234 try:235 app.test_client().get('/')236 except Warning:237 pass238 else:239 assert "Expected warning"240241242class JSONTestCase(unittest.TestCase):243244 def test_jsonify(self):245 d = dict(a=23, b=42, c=[1, 2, 3])
146 unmodified lines
modified:flask.py+6 added-1 removed
848 unmodified lines
849 def make_response(self, rv):850 """Converts the return value from a view function to a real851 response object that is an instance of :attr:`response_class`.852853 The following types are allowd for `rv`:853 The following types are allowed for `rv`:854855 ======================= ===========================================856 :attr:`response_class` the object is returned unchanged857 :class:`str` a response object is created with the
7 unmodified lines
865 ======================= ===========================================866867 :param rv: the return value from the view function868 """869 if rv is None:870 from warnings import warn871 warn(Warning('View function did not return a response'),872 stacklevel=2)873 return u''874 if isinstance(rv, self.response_class):875 return rv876 if isinstance(rv, basestring):877 return self.response_class(rv)
102 unmodified lines