In this posting, I explain how to run the Flask application on PyCharm.
Installation
On Mac
I used the HomeBrew for installation.
$ brew insstall --cask pycharm-ce
On Windows
I used the Chocolatey for installation.
$ choco install -y pycharm-community
Flask Application
Let's make a very simple application for testing.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, Flask'
if __name__ == '__main__':
app.run()
It will look like this.
Run Application
In this screen, PyCharm serves the default run configuration for us.
Let's modify this.
Click the "Edit Configurations...".
- Put the name that you want.
- Click the folder icon and select the Script path of Flask.
- Put the "run" as a parameter.
- Click the document icon to set the environment variables.
Add the environment variables refer to the screenshot.
All preparations are done.
Now, click the run button.
It works well !!
Now, enjoy developing the Flask on PyCharm.
'DevTools' 카테고리의 다른 글
[AWS] Windows EC2 Instance 사용하기 (4) | 2023.01.12 |
---|---|
Development on AWS EC2 through Termius and VSCode (0) | 2022.01.30 |
[VS Code] Extensions 추천 - (2021.09.17) (2) | 2021.09.17 |
정규 표현식 (Regular Expression) (0) | 2021.03.06 |
[PyCharm] Shortcuts (0) | 2021.01.31 |
댓글