update pycharm instructions
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 3e5ca29 · Browse files · 3 files·+22 added−39 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+22 added−39 removed
- other:+22 added−39 removed
Provenance
- Commit
4c08e3a- Tree
1f4ae75- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
3e5ca29
3 files changed+22 added−39 removed
added:docs/_static/pycharm-run-config.pngbinary
A binary file, added.
deleted:docs/_static/pycharm-runconfig.pngbinary
A binary file, deleted.
modified:docs/cli.rst+22 added-39 removed
550 unmodified lines551 552 PyCharm Integration553 -------------------554 555-PyCharm Professional provides a special Flask run configuration. For556-the Community Edition, we need to configure it to call the ``flask run``557-CLI command with the correct environment variables. These instructions558-should be similar for any other IDE you might want to use.555+PyCharm Professional provides a special Flask run configuration to run the development556+server. For the Community Edition, and for other commands besides ``run``, you need to557+create a custom run configuration. These instructions should be similar for any other558+IDE you use.559 560-In PyCharm, with your project open, click on *Run* from the menu bar and561-go to *Edit Configurations*. You'll be greeted by a screen similar to562-this:560+In PyCharm, with your project open, click on *Run* from the menu bar and go to *Edit561+Configurations*. You'll see a screen similar to this:562 564-.. image:: _static/pycharm-runconfig.png563+.. image:: _static/pycharm-run-config.png564 :align: center565 :class: screenshot567- :alt: Screenshot of PyCharms's run configuration settings.566+ :alt: Screenshot of PyCharm run configuration.567 569-There's quite a few options to change, but once we've done it for one570-command, we can easily copy the entire configuration and make a single571-tweak to give us access to other commands, including any custom ones you572-may implement yourself.568+Once you create a configuration for the ``flask run``, you can copy and change it to569+call any other command.570 574-Click the + (*Add New Configuration*) button and select *Python*. Give575-the configuration a name such as "flask run". For the ``flask run``576-command, check "Single instance only" since you can't run the server577-more than once at the same time.571+Click the *+ (Add New Configuration)* button and select *Python*. Give the configuration572+a name such as "flask run".573 579-Select *Module name* from the dropdown (**A**) then input ``flask``.574+Click the *Script path* dropdown and change it to *Module name*, then input ``flask``.575 581-The *Parameters* field (**B**) is set to the CLI command to execute582-(with any arguments). In this example we use ``run``, which will run583-the development server.576+The *Parameters* field is set to the CLI command to execute along with any arguments.577+This example uses ``--app hello --debug run``, which will run the development server in578+debug mode. ``--app hello`` should be the import or file with your Flask app.579 585-You can skip this next step if you're using :ref:`dotenv`. We need to586-add an environment variable (**C**) to identify our application. Click587-on the browse button and add an entry with ``FLASK_APP`` on the left and588-the Python import or file on the right (``hello`` for example). Add an589-entry with ``FLASK_ENV`` and set it to ``development``.580+If you installed your project as a package in your virtualenv, you may uncheck the581+*PYTHONPATH* options. This will more accurately match how you deploy later.582 591-Next we need to set the working directory (**D**) to be the folder where592-our application resides.583+Click *OK* to save and close the configuration. Select the configuration in the main584+PyCharm window and click the play button next to it to run the server.585 594-If you have installed your project as a package in your virtualenv, you595-may untick the *PYTHONPATH* options (**E**). This will more accurately596-match how you deploy the app later.597-598-Click *Apply* to save the configuration, or *OK* to save and close the599-window. Select the configuration in the main PyCharm window and click600-the play button next to it to run the server.601-602-Now that we have a configuration which runs ``flask run`` from within603-PyCharm, we can copy that configuration and alter the *Script* argument604-to run a different CLI command, e.g. ``flask shell``.586+Now that you have a configuration for ``flask run``, you can copy that configuration and587+change the *Parameters* argument to run a different CLI command.