Merge branch '2.0.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 9486b6c, c5ca175 · Browse files · 11 files·+122 added−65 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+122 added−65 removed
- other:+122 added−65 removed
Provenance
- Commit
edac7e3- Tree
ecb92c0- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent 1
9486b6c- Parent 2
c5ca175
11 files changed+122 added−65 removed
modified:docs/tutorial/factory.rst+5 added
175 unmodified lines176 Visit http://127.0.0.1:5000/hello in a browser and you should see the177 "Hello, World!" message. Congratulations, you're now running your Flask178 web application!179 180+If another program is already using port 5000, you'll see181+``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the182+server tries to start. See :ref:`address-already-in-use` for how to183+handle that.184+185 Continue to :doc:`database`.modified:docs/tutorial/layout.rst+22 added-22 removed
55 unmodified lines56 .. code-block:: none57 58 /home/user/Projects/flask-tutorial59 ├── flaskr/60- │ ├── __init__.py61- │ ├── db.py62- │ ├── schema.sql63- │ ├── auth.py64- │ ├── blog.py65- │ ├── templates/66- │ │ ├── base.html67- │ │ ├── auth/68- │ │ │ ├── login.html69- │ │ │ └── register.html70- │ │ └── blog/71- │ │ ├── create.html72- │ │ ├── index.html73- │ │ └── update.html74- │ └── static/75- │ └── style.css60+ │ ├── __init__.py61+ │ ├── db.py62+ │ ├── schema.sql63+ │ ├── auth.py64+ │ ├── blog.py65+ │ ├── templates/66+ │ │ ├── base.html67+ │ │ ├── auth/68+ │ │ │ ├── login.html69+ │ │ │ └── register.html70+ │ │ └── blog/71+ │ │ ├── create.html72+ │ │ ├── index.html73+ │ │ └── update.html74+ │ └── static/75+ │ └── style.css76 ├── tests/77- │ ├── conftest.py78- │ ├── data.sql79- │ ├── test_factory.py80- │ ├── test_db.py81- │ ├── test_auth.py82- │ └── test_blog.py77+ │ ├── conftest.py78+ │ ├── data.sql79+ │ ├── test_factory.py80+ │ ├── test_db.py81+ │ ├── test_auth.py82+ │ └── test_blog.py83 ├── venv/84 ├── setup.py85 └── MANIFEST.in86 24 unmodified linesmodified:docs/cli.rst+5 added
101 unmodified lines102 Only use the development server during development. The development server103 is provided for convenience, but is not designed to be particularly secure,104 stable, or efficient. See :doc:`/deploying/index` for how to run in production.105 106+If another program is already using port 5000, you'll see107+``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the108+server tries to start. See :ref:`address-already-in-use` for how to109+handle that.110 111+112 Open a Shell113 ------------114 115 To explore the data in your application, you can start an interactive Python543 unmodified linesmodified:docs/quickstart.rst+5 added
81 unmodified lines82 83 Now head over to http://127.0.0.1:5000/, and you should see your hello84 world greeting.85 86+If another program is already using port 5000, you'll see87+``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the88+server tries to start. See :ref:`address-already-in-use` for how to89+handle that.90+91 .. _public-server:92 93 .. admonition:: Externally Visible Server94 849 unmodified linesmodified:docs/server.rst+41 added
62 unmodified lines63 you should prefer setting the development environment as shown64 above.65 66 67+.. _address-already-in-use:68+69+Address already in use70+~~~~~~~~~~~~~~~~~~~~~~71+72+If another program is already using port 5000, you'll see an ``OSError``73+when the server tries to start. It may have one of the following74+messages:75+76+- ``OSError: [Errno 98] Address already in use``77+- ``OSError: [WinError 10013] An attempt was made to access a socket78+ in a way forbidden by its access permissions``79+80+Either identify and stop the other program, or use81+``flask run --port 5001`` to pick a different port.82+83+You can use ``netstat`` to identify what process id is using a port,84+then use other operating system tools stop that process. The following85+example shows that process id 6847 is using port 5000.86+87+.. tabs::88+89+ .. group-tab:: Linux/Mac90+91+ .. code-block:: text92+93+ $ netstat -nlp | grep 500094+ tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 6847/python95+96+ .. group-tab:: Windows97+98+ .. code-block:: text99+100+ > netstat -ano | findstr 5000101+ TCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 6847102+103+MacOS Monterey and later automatically starts a service that uses port104+5000. To disable the service, go to System Preferences, Sharing, and105+disable "AirPlay Receiver".106+107+108 Lazy or Eager Loading109 ~~~~~~~~~~~~~~~~~~~~~110 111 When using the ``flask run`` command with the reloader, the server will39 unmodified linesmodified:requirements/dev.txt+24 added-23 removed
10 unmodified lines11 attrs==21.2.012 # via pytest13 babel==2.9.114 # via sphinx15-backports.entry-points-selectable==1.1.015+backports.entry-points-selectable==1.1.116 # via virtualenv17 blinker==1.418 # via -r requirements/tests.in19 certifi==2021.10.81 unmodified line21 cffi==1.15.022 # via cryptography23 cfgv==3.3.124 # via pre-commit25-charset-normalizer==2.0.725+charset-normalizer==2.0.926 # via requests27 click==8.0.328 # via pip-tools29-cryptography==35.0.029+cryptography==36.0.130 # via -r requirements/typing.in31-distlib==0.3.331+distlib==0.3.432 # via virtualenv33 docutils==0.1634 # via35 # sphinx36 # sphinx-tabs37-filelock==3.3.237+filelock==3.4.038 # via39 # tox40 # virtualenv41 greenlet==1.1.2 ; python_version < "3.11"42 # via -r requirements/tests.in43-identify==2.3.343+identify==2.4.044 # via pre-commit45 idna==3.346 # via requests47-imagesize==1.2.047+imagesize==1.3.048 # via sphinx49 iniconfig==1.1.150 # via pytest51-jinja2==3.0.251+jinja2==3.0.352 # via sphinx53 markupsafe==2.0.154 # via jinja255-mypy==0.91055+mypy==0.93056 # via -r requirements/typing.in57 mypy-extensions==0.4.358 # via mypy59 nodeenv==1.6.060 # via pre-commit61-packaging==21.261+packaging==21.362 # via63 # pallets-sphinx-themes64 # pytest65 # sphinx66 # tox67-pallets-sphinx-themes==2.0.167+pallets-sphinx-themes==2.0.268 # via -r requirements/docs.in69 pep517==0.12.070 # via pip-tools71 pip-tools==6.4.03 unmodified lines75 pluggy==1.0.076 # via77 # pytest78 # tox79-pre-commit==2.15.079+pre-commit==2.16.080 # via -r requirements/dev.in81 py==1.11.082 # via83 # pytest84 # tox85-pycparser==2.2085+pycparser==2.2186 # via cffi87 pygments==2.10.088 # via89 # sphinx90 # sphinx-tabs91-pyparsing==2.4.791+pyparsing==3.0.692 # via packaging93 pytest==6.2.594 # via -r requirements/tests.in95-python-dotenv==0.19.195+python-dotenv==0.19.296 # via -r requirements/tests.in97 pytz==2021.398 # via babel99 pyyaml==6.03 unmodified lines103 six==1.16.0104 # via105 # tox106 # virtualenv107-snowballstemmer==2.1.0107+snowballstemmer==2.2.0108 # via sphinx109-sphinx==4.2.0109+sphinx==4.3.2110 # via111 # -r requirements/docs.in112 # pallets-sphinx-themes113 # sphinx-issues18 unmodified lines132 sphinxcontrib-serializinghtml==1.1.5133 # via sphinx134 toml==0.10.2135 # via136- # mypy136 # pre-commit137 # pytest138 # tox140-tomli==1.2.2141- # via pep517139+tomli==2.0.0140+ # via141+ # mypy142+ # pep517143 tox==3.24.4144 # via -r requirements/dev.in145 types-contextvars==2.4.0146 # via -r requirements/typing.in147 types-dataclasses==0.6.1148 # via -r requirements/typing.in148-types-setuptools==57.4.2149+types-setuptools==57.4.4150 # via -r requirements/typing.in150-typing-extensions==3.10.0.2151+typing-extensions==4.0.1152 # via mypy153 urllib3==1.26.7154 # via requests155 virtualenv==20.10.0156 # via157 # pre-commit158 # tox158-wheel==0.37.0159+wheel==0.37.1160 # via pip-tools161 162 # The following packages are considered to be unsafe in a requirements file:163 # pip1 unmodified linemodified:requirements/docs.txt+8 added-8 removed
8 unmodified lines9 babel==2.9.110 # via sphinx11 certifi==2021.10.812 # via requests13-charset-normalizer==2.0.713+charset-normalizer==2.0.914 # via requests15 docutils==0.1616 # via17 # sphinx18 # sphinx-tabs19 idna==3.320 # via requests21-imagesize==1.2.021+imagesize==1.3.022 # via sphinx23-jinja2==3.0.223+jinja2==3.0.324 # via sphinx25 markupsafe==2.0.126 # via jinja227-packaging==21.227+packaging==21.328 # via29 # pallets-sphinx-themes30 # sphinx31-pallets-sphinx-themes==2.0.131+pallets-sphinx-themes==2.0.232 # via -r requirements/docs.in33 pygments==2.10.034 # via35 # sphinx36 # sphinx-tabs37-pyparsing==2.4.737+pyparsing==3.0.638 # via packaging39 pytz==2021.340 # via babel41 requests==2.26.042 # via sphinx43-snowballstemmer==2.1.043+snowballstemmer==2.2.044 # via sphinx45-sphinx==4.2.045+sphinx==4.3.246 # via47 # -r requirements/docs.in48 # pallets-sphinx-themes49 # sphinx-issues25 unmodified linesmodified:requirements/tests.txt+3 added-3 removed
12 unmodified lines13 greenlet==1.1.2 ; python_version < "3.11"14 # via -r requirements/tests.in15 iniconfig==1.1.116 # via pytest17-packaging==21.217+packaging==21.318 # via pytest19 pluggy==1.0.020 # via pytest21 py==1.11.022 # via pytest23-pyparsing==2.4.723+pyparsing==3.0.624 # via packaging25 pytest==6.2.526 # via -r requirements/tests.in27-python-dotenv==0.19.127+python-dotenv==0.19.228 # via -r requirements/tests.in29 toml==0.10.230 # via pytestmodified:requirements/typing.txt+6 added-6 removed
4 unmodified lines5 # pip-compile requirements/typing.in6 #7 cffi==1.15.08 # via cryptography9-cryptography==35.0.09+cryptography==36.0.110 # via -r requirements/typing.in11-mypy==0.91011+mypy==0.93012 # via -r requirements/typing.in13 mypy-extensions==0.4.314 # via mypy15-pycparser==2.2015+pycparser==2.2116 # via cffi17-toml==0.10.217+tomli==2.0.018 # via mypy19 types-contextvars==2.4.020 # via -r requirements/typing.in21 types-dataclasses==0.6.122 # via -r requirements/typing.in23-types-setuptools==57.4.223+types-setuptools==57.4.424 # via -r requirements/typing.in25-typing-extensions==3.10.0.225+typing-extensions==4.0.126 # via mypymodified:src/flask/helpers.py+1 added-1 removed
687 unmodified lines688 """689 # Module already imported and has a file attribute. Use that first.690 mod = sys.modules.get(import_name)691 692- if mod is not None and hasattr(mod, "__file__"):692+ if mod is not None and hasattr(mod, "__file__") and mod.__file__ is not None:693 return os.path.dirname(os.path.abspath(mod.__file__))694 695 # Next attempt: check the loader.696 loader = pkgutil.get_loader(import_name)94 unmodified linesmodified:.pre-commit-config.yaml+2 added-2 removed
1 ci:2 autoupdate_schedule: monthly3 repos:4 - repo: https://github.com/asottile/pyupgrade5- rev: v2.29.05+ rev: v2.29.16 hooks:7 - id: pyupgrade8 args: ["--py36-plus"]9 - repo: https://github.com/asottile/reorder_python_imports3 unmodified lines13 name: Reorder Python imports (src, tests)14 files: "^(?!examples/)"15 args: ["--application-directories", "src"]16 - repo: https://github.com/psf/black17- rev: 21.10b017+ rev: 21.12b018 hooks:19 - id: black20 - repo: https://github.com/PyCQA/flake821 rev: 4.0.111 unmodified lines