Skip to content
Myr

Merge branch '1.1.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 3d61fc4, 93dd170 · Browse files · 6 files+34 added−31 removed
This commit

State

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

Diff stats

6 files+34 added−31 removed

  • other:+34 added−31 removed

6 files+34 added−31 removed

modified:docs/cli.rst+10 added-9 removed
489 unmodified lines
490491PyCharm Integration492-------------------493494Prior to PyCharm 2018.1, the Flask CLI features weren't yet fully495integrated into PyCharm. We have to do a few tweaks to get them working496smoothly. These instructions should be similar for any other IDE you497might want to use.494PyCharm Professional provides a special Flask run configuration. For495the Community Edition, we need to configure it to call the ``flask run``496CLI command with the correct environment variables. These instructions497should be similar for any other IDE you might want to use.498499In PyCharm, with your project open, click on *Run* from the menu bar and500go to *Edit Configurations*. You'll be greeted by a screen similar to501this:502503.. image:: _static/pycharm-runconfig.png504 :align: center505 :class: screenshot506 :alt: screenshot of pycharm's run configuration settings506 :alt: Screenshot of PyCharms's run configuration settings.507508There's quite a few options to change, but once we've done it for one509command, we can easily copy the entire configuration and make a single510tweak to give us access to other commands, including any custom ones you511may implement yourself.512513Click the + (*Add New Configuration*) button and select *Python*. Give514the configuration a good descriptive name such as "Run Flask Server".515For the ``flask run`` command, check "Single instance only" since you516can't run the server more than once at the same time.514the configuration a name such as "flask run". For the ``flask run``515command, check "Single instance only" since you can't run the server516more than once at the same time.517518Select *Module name* from the dropdown (**A**) then input ``flask``.519520The *Parameters* field (**B**) is set to the CLI command to execute
2 unmodified lines
523524You can skip this next step if you're using :ref:`dotenv`. We need to525add an environment variable (**C**) to identify our application. Click526on the browse button and add an entry with ``FLASK_APP`` on the left and527the Python import or file on the right (``hello`` for example).527the Python import or file on the right (``hello`` for example). Add an528entry with ``FLASK_ENV`` and set it to ``development``.529530Next we need to set the working directory (**D**) to be the folder where531our application resides.532
11 unmodified lines
modified:src/flask/__init__.py+1 added-1 removed
55 unmodified lines
56from .signals import template_rendered57from .templating import render_template58from .templating import render_template_string5960__version__ = "1.2.0.dev0"60__version__ = "1.2.0.dev"
modified:src/flask/app.py+16 added-15 removed
167 unmodified lines
168 :param import_name: the name of the application package169 :param static_url_path: can be used to specify a different path for the170 static files on the web. Defaults to the name171 of the `static_folder` folder.172 :param static_folder: the folder with static files that should be served173 at `static_url_path`. Defaults to the ``'static'``174 folder in the root path of the application.172 :param static_folder: The folder with static files that is served at173 ``static_url_path``. Relative to the application ``root_path``174 or an absolute path. Defaults to ``'static'``.175 :param static_host: the host to use when adding the static route.176 Defaults to None. Required when using ``host_matching=True``177 with a ``static_folder`` configured.178 :param host_matching: set ``url_map.host_matching`` attribute.
895 unmodified lines
1074 :attr:`secret_key` is set. Instead of overriding this method1075 we recommend replacing the :class:`session_interface`.10761077 .. deprecated: 1.01078 Will be removed in 1.1. Use ``session_interface.open_session``1079 instead.1078 Will be removed in 2.0. Use1079 ``session_interface.open_session`` instead.10801081 :param request: an instance of :attr:`request_class`.1082 """10831084 warnings.warn(1085 DeprecationWarning(1086 '"open_session" is deprecated and will be removed in 1.1. Use'1087 ' "session_interface.open_session" instead.'1086 '"open_session" is deprecated and will be removed in'1087 ' 2.0. Use "session_interface.open_session" instead.'1088 )1089 )1090 return self.session_interface.open_session(self, request)1091
2 unmodified lines
1094 implementation, check :meth:`open_session`. Instead of overriding this1095 method we recommend replacing the :class:`session_interface`.10961097 .. deprecated: 1.01098 Will be removed in 1.1. Use ``session_interface.save_session``1099 instead.1098 Will be removed in 2.0. Use1099 ``session_interface.save_session`` instead.11001101 :param session: the session to be saved (a1102 :class:`~werkzeug.contrib.securecookie.SecureCookie`1103 object)
1 unmodified line
1105 """11061107 warnings.warn(1108 DeprecationWarning(1109 '"save_session" is deprecated and will be removed in 1.1. Use'1110 ' "session_interface.save_session" instead.'1109 '"save_session" is deprecated and will be removed in'1110 ' 2.0. Use "session_interface.save_session" instead.'1111 )1112 )1113 return self.session_interface.save_session(self, session, response)1114
1 unmodified line
1116 """Creates a new instance of a missing session. Instead of overriding1117 this method we recommend replacing the :class:`session_interface`.11181119 .. deprecated: 1.01120 Will be removed in 1.1. Use ``session_interface.make_null_session``1121 instead.1120 Will be removed in 2.0. Use1121 ``session_interface.make_null_session`` instead.11221123 .. versionadded:: 0.71124 """11251126 warnings.warn(1127 DeprecationWarning(1128 '"make_null_session" is deprecated and will be removed in 1.1. Use'1129 ' "session_interface.make_null_session" instead.'1128 '"make_null_session" is deprecated and will be removed'1129 ' in 2.0. Use "session_interface.make_null_session"'1130 " instead."1131 )1132 )1133 return self.session_interface.make_null_session(self)1134
1324 unmodified lines
modified:src/flask/testing.py+5 added-5 removed
97 unmodified lines
98def make_test_environ_builder(*args, **kwargs):99 """Create a :class:`flask.testing.EnvironBuilder`.100101 .. deprecated: 1.1102 Will be removed in 1.2. Construct ``flask.testing.EnvironBuilder``103 directly instead.102 Will be removed in 2.0. Construct103 ``flask.testing.EnvironBuilder`` directly instead.104 """105 warnings.warn(106 DeprecationWarning(107 '"make_test_environ_builder()" is deprecated and will be removed '108 'in 1.2. Construct "flask.testing.EnvironBuilder" directly '109 "instead."107 '"make_test_environ_builder()" is deprecated and will be'108 ' removed in 2.0. Construct "flask.testing.EnvironBuilder"'109 " directly instead."110 )111 )112 return EnvironBuilder(*args, **kwargs)113
170 unmodified lines
modified:CHANGES.rst+1 added-1 removed
21 unmodified lines
2223Version 1.1.224-------------2526Unreleased26Released 2020-04-032728- Work around an issue when running the ``flask`` command with an29 external debugger on Windows. :issue:`3297`30- The static route will not catch all URLs if the ``Flask``
1008 unmodified lines
modified:MANIFEST.in+1 added
4 unmodified lines
5graft docs6prune docs/_build7graft examples8graft tests9global-exclude *.pyc