Flask in PyCharm Community Edition

Mushtaque Ahmed
3 min readMay 23, 2020


Run and Config a Flask App in PyCharm Community Edition

As we know there is no direct support to start a flask project in in PyCharm Community Edition unlike the Professional Version. So we have to setup everything from scratch. So here are few simple steps to start a flask project and set it up.

PreRequisite : You have pip and python3 installed. If you don’t then run these commands in terminal

brew install pip
pip -version
brew install python
  1. Start a Pure python project and give the project name (flaskTest) and select the virtualenv
Creating a project and virtual env
This will be the folder structure
  1. Create two files (requirement.txt) which holds all python dependencies and a simple python file (test.py)

Add these dependencies in the requirement.txt file

# This file is used by pip to install required python packages
# Usage: pip install -r requirements.txt

# Flask Framework

# Flask Packages

# Automated tests

There will be install plugin message on top of the requirements.txt file. Click it to download the plugins. If not then open terminal from the bottom and run this command

pip install -r requirements.txt

And add these line in test.py

from flask import Flask

app = Flask(__name__)
def hello_world():
return 'hello test'
if __name__ == '__main__':

Now lets setup the configuration

  1. Select Add configuration on top right of the PyCharm CE and Add a Python configuration and name the configuration (Test)

2. Set up Script Path: We need to setup flask plugin path here as below:

3. Set Environment Variable.

1. FLASK_APP : Test.py
2. FLASK_ENV : development

FLASK_DEBUG helps you for hot reloading. When you change your code and save. The flask server will restart with new modified code.

Now run the flask app by clicking the run button beside the configuration. The flask server will be launched and the app hosted at http://localhost:5000/

You can open postman and hit the url to get the response or can open that in a web browser.

PS : If the flask app don’t run then to be on safer side run this command to set the flask app env variable in venv terminal

export FLASK_APP=test.pyflask run

Next Part we will see how to Create few simple API’s in Flask and host it locally and set up a DB to store the data and carry out all CRUD operations using APIs and unit test it.

Please leave few claps if it was useful and follow me for more such articles.



Mushtaque Ahmed

Mobile Architect | iOS | Swift | RxSwift | GRPC | VIPER | | Protocol Oriented Programming | Realm | cocoapods | Appium | HTML | React.js | React Native