smaller, optimized image
Before adoption: this commit came in with the history the project adopted, so no landing records it.
reword / reformat the docs fix tox build directory
authored by David Lord · committed by David Lord · parent 5892a6f · Browse files · 3 files·+39 added−28 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+39 added−28 removed
- other:+39 added−28 removed
Provenance
- Commit
c11fe5d- Tree
02b2f79- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
5892a6f
3 files changed+39 added−28 removed
modified:docs/_static/pycharm-runconfig.pngbinary
A binary file, modified.
modified:docs/cli.rst+37 added-26 removed
341 unmodified lines342 343 PyCharm Integration344 -------------------345 346-The new Flask CLI features aren't yet fully integrated into the PyCharm IDE,347-so we have to do a few tweaks to get them working smoothly. These instructions348-should be similar for any other IDE you might want to use.346+The Flask CLI features aren't yet fully integrated into the PyCharm IDE,347+so we have to do a few tweaks to get them working smoothly. These348+instructions should be similar for any other IDE you might want to use.349 350-In PyCharm, with your project open, click on *Run* from the menu bar and go to351-*Edit Configurations*. You'll be greeted by a screen similar to this:350+In PyCharm, with your project open, click on *Run* from the menu bar and351+go to *Edit Configurations*. You'll be greeted by a screen similar to352+this:353 354 .. image:: _static/pycharm-runconfig.png354- :align: center355- :class: screenshot356- :alt: screenshot of pycharm's run configuration settings355+ :align: center356+ :class: screenshot357+ :alt: screenshot of pycharm's run configuration settings358 358-There's quite a few options to change, but once we've done it for one command,359-we can easily copy the entire configuration and make a single tweak to give us360-access to other commands, including any custom ones you may implement yourself.359+There's quite a few options to change, but once we've done it for one360+command, we can easily copy the entire configuration and make a single361+tweak to give us access to other commands, including any custom ones you362+may implement yourself.363 362-Since PyCharm 2017.3, you can run modules instead of needing to find ``flask``363-executable. For the *Module name* input (**A**), you just need to input ``flask``.364+Click the + (*Add New Configuration*) button and select *Python*. Give365+the configuration a good descriptive name such as "Run Flask Server".366+For the ``flask run`` command, check "Single instance only" since you367+can't run the server more than once at the same time.368 365-The *Parameters* field (**B**) is set to the CLI command you to execute.366-In this example we use ``run``, which will run the development server.369+Select *Module name* from the dropdown (**A**) then input ``flask``.370 368-You can skip this next step if you're using :ref:`dotenv`. We need to add an369-environment variable (**C**) to identify our application. Click on the browse370-button and add an entry with ``FLASK_APP`` on the left and the name of the371-Python file or package on the right (``app.py`` for example).371+The *Parameters* field (**B**) is set to the CLI command to execute372+(with any arguments). In this example we use ``run``, which will run373+the development server.374 373-Next we need to set the working directory (**D**) to be the same folder where374-our application file or package resides. PyCharm changed it to the directory375-with the ``flask`` executable when we selected it earlier, which is incorrect.375+You can skip this next step if you're using :ref:`dotenv`. We need to376+add an environment variable (**C**) to identify our application. Click377+on the browse button and add an entry with ``FLASK_APP`` on the left and378+the Python import or file on the right (``hello`` for example).379 377-Finally, untick the *PYTHONPATH* options (**E**) and give the configuration a378-good descriptive name, such as "Run Flask Server", and click *Apply*.380+Next we need to set the working directory (**D**) to be the folder where381+our application resides.382 383+If you have installed your project as a package in your virtualenv, you384+may untick the *PYTHONPATH* options (**E**). This will more accurately385+match how you deploy the app later.386+387+Click *Apply* to save the configuration, or *OK* to save and close the388+window. Select the configuration in the main PyCharm window and click389+the play button next to it to run the server.390+380-Now that we have a configuration which runs ``flask run`` from within PyCharm,381-we can simply copy that configuration and alter the *Script* argument391+Now that we have a configuration which runs ``flask run`` from within392+PyCharm, we can copy that configuration and alter the *Script* argument393 to run a different CLI command, e.g. ``flask shell``.modified:tox.ini+2 added-2 removed
38 unmodified lines39 coverage run -p -m pytest tests examples40 41 [testenv:docs-html]42 deps = sphinx43-commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html43+commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html44 45 [testenv:docs-linkcheck]46 deps = sphinx47-commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck47+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs {envtmpdir}/linkcheck48 49 [testenv:coverage-report]50 deps = coverage51 skip_install = true15 unmodified lines