Skip to content
Myr

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

11 files+122 added−65 removed

modified:docs/tutorial/factory.rst+5 added
175 unmodified lines
176Visit http://127.0.0.1:5000/hello in a browser and you should see the177"Hello, World!" message. Congratulations, you're now running your Flask178web application!179180If another program is already using port 5000, you'll see181``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the182server tries to start. See :ref:`address-already-in-use` for how to183handle that.184185Continue to :doc:`database`.
modified:docs/tutorial/layout.rst+22 added-22 removed
55 unmodified lines
56.. code-block:: none5758 /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 lines
modified:docs/cli.rst+5 added
101 unmodified lines
102 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.105106If another program is already using port 5000, you'll see107``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the108server tries to start. See :ref:`address-already-in-use` for how to109handle that.110111112Open a Shell113------------114115To explore the data in your application, you can start an interactive Python
543 unmodified lines
modified:docs/quickstart.rst+5 added
81 unmodified lines
8283Now head over to http://127.0.0.1:5000/, and you should see your hello84world greeting.8586If another program is already using port 5000, you'll see87``OSError: [Errno 98]`` or ``OSError: [WinError 10013]`` when the88server tries to start. See :ref:`address-already-in-use` for how to89handle that.9091.. _public-server:9293.. admonition:: Externally Visible Server94
849 unmodified lines
modified:docs/server.rst+41 added
62 unmodified lines
63 you should prefer setting the development environment as shown64 above.656667.. _address-already-in-use:6869Address already in use70~~~~~~~~~~~~~~~~~~~~~~7172If another program is already using port 5000, you'll see an ``OSError``73when the server tries to start. It may have one of the following74messages:7576- ``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``7980Either identify and stop the other program, or use81``flask run --port 5001`` to pick a different port.8283You can use ``netstat`` to identify what process id is using a port,84then use other operating system tools stop that process. The following85example shows that process id 6847 is using port 5000.8687.. tabs::8889 .. group-tab:: Linux/Mac9091 .. code-block:: text9293 $ netstat -nlp | grep 500094 tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 6847/python9596 .. group-tab:: Windows9798 .. code-block:: text99100 > netstat -ano | findstr 5000101 TCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 6847102103MacOS Monterey and later automatically starts a service that uses port1045000. To disable the service, go to System Preferences, Sharing, and105disable "AirPlay Receiver".106107108Lazy or Eager Loading109~~~~~~~~~~~~~~~~~~~~~110111When using the ``flask run`` command with the reloader, the server will
39 unmodified lines
modified:requirements/dev.txt+24 added-23 removed
10 unmodified lines
11attrs==21.2.012 # via pytest13babel==2.9.114 # via sphinx15backports.entry-points-selectable==1.1.015backports.entry-points-selectable==1.1.116 # via virtualenv17blinker==1.418 # via -r requirements/tests.in19certifi==2021.10.8
1 unmodified line
21cffi==1.15.022 # via cryptography23cfgv==3.3.124 # via pre-commit25charset-normalizer==2.0.725charset-normalizer==2.0.926 # via requests27click==8.0.328 # via pip-tools29cryptography==35.0.029cryptography==36.0.130 # via -r requirements/typing.in31distlib==0.3.331distlib==0.3.432 # via virtualenv33docutils==0.1634 # via35 # sphinx36 # sphinx-tabs37filelock==3.3.237filelock==3.4.038 # via39 # tox40 # virtualenv41greenlet==1.1.2 ; python_version < "3.11"42 # via -r requirements/tests.in43identify==2.3.343identify==2.4.044 # via pre-commit45idna==3.346 # via requests47imagesize==1.2.047imagesize==1.3.048 # via sphinx49iniconfig==1.1.150 # via pytest51jinja2==3.0.251jinja2==3.0.352 # via sphinx53markupsafe==2.0.154 # via jinja255mypy==0.91055mypy==0.93056 # via -r requirements/typing.in57mypy-extensions==0.4.358 # via mypy59nodeenv==1.6.060 # via pre-commit61packaging==21.261packaging==21.362 # via63 # pallets-sphinx-themes64 # pytest65 # sphinx66 # tox67pallets-sphinx-themes==2.0.167pallets-sphinx-themes==2.0.268 # via -r requirements/docs.in69pep517==0.12.070 # via pip-tools71pip-tools==6.4.0
3 unmodified lines
75pluggy==1.0.076 # via77 # pytest78 # tox79pre-commit==2.15.079pre-commit==2.16.080 # via -r requirements/dev.in81py==1.11.082 # via83 # pytest84 # tox85pycparser==2.2085pycparser==2.2186 # via cffi87pygments==2.10.088 # via89 # sphinx90 # sphinx-tabs91pyparsing==2.4.791pyparsing==3.0.692 # via packaging93pytest==6.2.594 # via -r requirements/tests.in95python-dotenv==0.19.195python-dotenv==0.19.296 # via -r requirements/tests.in97pytz==2021.398 # via babel99pyyaml==6.0
3 unmodified lines
103six==1.16.0104 # via105 # tox106 # virtualenv107snowballstemmer==2.1.0107snowballstemmer==2.2.0108 # via sphinx109sphinx==4.2.0109sphinx==4.3.2110 # via111 # -r requirements/docs.in112 # pallets-sphinx-themes113 # sphinx-issues
18 unmodified lines
132sphinxcontrib-serializinghtml==1.1.5133 # via sphinx134toml==0.10.2135 # via136 # mypy136 # pre-commit137 # pytest138 # tox140tomli==1.2.2141 # via pep517139tomli==2.0.0140 # via141 # mypy142 # pep517143tox==3.24.4144 # via -r requirements/dev.in145types-contextvars==2.4.0146 # via -r requirements/typing.in147types-dataclasses==0.6.1148 # via -r requirements/typing.in148types-setuptools==57.4.2149types-setuptools==57.4.4150 # via -r requirements/typing.in150typing-extensions==3.10.0.2151typing-extensions==4.0.1152 # via mypy153urllib3==1.26.7154 # via requests155virtualenv==20.10.0156 # via157 # pre-commit158 # tox158wheel==0.37.0159wheel==0.37.1160 # via pip-tools161162# The following packages are considered to be unsafe in a requirements file:163# pip
1 unmodified line
modified:requirements/docs.txt+8 added-8 removed
8 unmodified lines
9babel==2.9.110 # via sphinx11certifi==2021.10.812 # via requests13charset-normalizer==2.0.713charset-normalizer==2.0.914 # via requests15docutils==0.1616 # via17 # sphinx18 # sphinx-tabs19idna==3.320 # via requests21imagesize==1.2.021imagesize==1.3.022 # via sphinx23jinja2==3.0.223jinja2==3.0.324 # via sphinx25markupsafe==2.0.126 # via jinja227packaging==21.227packaging==21.328 # via29 # pallets-sphinx-themes30 # sphinx31pallets-sphinx-themes==2.0.131pallets-sphinx-themes==2.0.232 # via -r requirements/docs.in33pygments==2.10.034 # via35 # sphinx36 # sphinx-tabs37pyparsing==2.4.737pyparsing==3.0.638 # via packaging39pytz==2021.340 # via babel41requests==2.26.042 # via sphinx43snowballstemmer==2.1.043snowballstemmer==2.2.044 # via sphinx45sphinx==4.2.045sphinx==4.3.246 # via47 # -r requirements/docs.in48 # pallets-sphinx-themes49 # sphinx-issues
25 unmodified lines
modified:requirements/tests.txt+3 added-3 removed
12 unmodified lines
13greenlet==1.1.2 ; python_version < "3.11"14 # via -r requirements/tests.in15iniconfig==1.1.116 # via pytest17packaging==21.217packaging==21.318 # via pytest19pluggy==1.0.020 # via pytest21py==1.11.022 # via pytest23pyparsing==2.4.723pyparsing==3.0.624 # via packaging25pytest==6.2.526 # via -r requirements/tests.in27python-dotenv==0.19.127python-dotenv==0.19.228 # via -r requirements/tests.in29toml==0.10.230 # via pytest
modified:requirements/typing.txt+6 added-6 removed
4 unmodified lines
5# pip-compile requirements/typing.in6#7cffi==1.15.08 # via cryptography9cryptography==35.0.09cryptography==36.0.110 # via -r requirements/typing.in11mypy==0.91011mypy==0.93012 # via -r requirements/typing.in13mypy-extensions==0.4.314 # via mypy15pycparser==2.2015pycparser==2.2116 # via cffi17toml==0.10.217tomli==2.0.018 # via mypy19types-contextvars==2.4.020 # via -r requirements/typing.in21types-dataclasses==0.6.122 # via -r requirements/typing.in23types-setuptools==57.4.223types-setuptools==57.4.424 # via -r requirements/typing.in25typing-extensions==3.10.0.225typing-extensions==4.0.126 # via mypy
modified:src/flask/helpers.py+1 added-1 removed
687 unmodified lines
688 """689 # Module already imported and has a file attribute. Use that first.690 mod = sys.modules.get(import_name)691692 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__))694695 # Next attempt: check the loader.696 loader = pkgutil.get_loader(import_name)
94 unmodified lines
modified:.pre-commit-config.yaml+2 added-2 removed
1ci:2 autoupdate_schedule: monthly3repos: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_imports
3 unmodified lines
13 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.1
11 unmodified lines