Skip to content
Myr

update CLI docs IDE integration

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 · parent ac9589c · Browse files · 1 file+10 added−9 removed
This commit

State

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

Diff stats

1 file+10 added−9 removed

  • other:+10 added−9 removed

1 file+10 added−9 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