Flask in PyCharm Community Edition

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)
# This file is used by pip to install required python packages
# Usage: pip install -r requirements.txt

# Flask Framework
click==7.1.2
Flask==2.0.2
itsdangerous==2.0.1
Jinja2==3.0.0
MarkupSafe==2.0.0rc2
Werkzeug==2.0.0

# Flask Packages
Flask-Login==0.4.0
Flask-Migrate==2.0.2
Flask-Script==2.0.5
Flask-SQLAlchemy==2.4.0
Flask-WTF==0.14.2
Flask-User==1.0.1.5

# Automated tests
pytest==3.0.5
pytest-cov==2.4.0
pip install -r requirements.txt
from flask import Flask

app = Flask(__name__)
@app.route('/')
def hello_world():
return 'hello test'
if __name__ == '__main__':
app.run()
  1. Select Add configuration on top right of the PyCharm CE and Add a Python configuration and name the configuration (Test)
export FLASK_APP=test.pyflask run
Please leave few claps if it was useful and follow me for more such articles.

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Demo of Automated Testing for Windows Desktop App: TestWise tests TestWise

From zero to WIP

Run a Postgres instance for cheap in Google Cloud

An elephant

Here’s How One Can Change the Shortcut That Opens Game Bar on Windows 10

AEC Information Containers as Project APIs

Simple CTF

Security : Http Session vs JWT

CI/CD Using Github Actions And Amazon AWS S3

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mushtaque Ahmed

Mushtaque Ahmed

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

More from Medium

Currencylayer API data to Pandas Dataframe

How To Install TensorFlow Version 2.8 on The M1 chip Macbook With Ease

Lambda Function in Python.

How to Create a MongoDB API Endpoint on a Multi-Page Dash App