- Step 1:
pipenv install --python 3.8 - Step 2:
pipenv shell - Step 3:
pipenv install flask flask-sqlalchemy flask-marshmallow marshmallow-sqlalchemy flask-migrate psycopg2
flask-sqlalchemy is the sql-alchemy with flask bindings. flask-marshmallow is like the Serializer in Django Rest Framework, marshmallow-sqlalchemy is common binding between marshmallow and sqlalchemy (for things like ModelSerializer in Django Rest Framework).flask-migrate is migration tool for Flask based on ALEMBIC.psycopg2-binary is for connecting to postgres db.
My Channel Link:tutorial for beginners: In this Tutorial you will learn how to create flask application o. In the webinar, Abby covered: Using Cloud Code (A PyCharm plugin) that can be used to create new projects with a Flask or a Django template Building your flask Cloud Run application locally, and then deploying it to GCP Automatic rebuild.
Note: If psycopg2 install gives errors use psycopg2-binary. But this is a development only binary. It is not meant for production. For production, you need to compile psycopg2 from source.
See here for installing psycopg2 if you face issues: https://tekshinobi.com/install-psycopg2-on-ubuntu-18-04/

Now create the application file.. traditionally called app.py (or main.py…whatever your taste).touch app.py
Stick in this boilerplate code in app.py.
2 4 6 8 10 12 | @app.route('/') return'Hello World' app.run() |
The project structure at this moment looks like this:
proj_dir/app.py
Pycharm License Server Free
That’s right. Just my project directory with one file called app.py.
Click on “Add Configuration” button on top right. Under Templates, choose Python.
Select “Module name” instead of “Script path” and type flask.
Parameters: run
Environment Variables: PYTHONUNBUFFERED=1;FLASK_APP=app.py;FLASK_ENV=development

Python Interpreter: (your location of python interpreter in your virtual environment)
Working directory: (your location of python interpreter in your virtual environment)/bin
Note: Python Interpreter and Worrking directory are already filled if you already selected Python interpreter though Pycharm settings before configuring this Flask configuration.
Give your configuration a name. I often call it Flask.
Finally, it will look something like this (note: my pipenv created virtualenv is called tutorial)
Now do these steps on the console (don’t do the third step yet as app.py is still empty):
- export FLASK_APP=app.py
- export FLASK_ENV=development
- flask run
The no. 2 in above list is important. It will hot reload the server upon code changes
As of writing this post, there has been a bug with Werkzeug and Flask latest versions in PyPi and the Pycharm debugger. The bug only affects when debugger is run in development mode (FLASK_ENV=development; FLASK_DEBUG=1). If you run in production mode, there is no error. But its kinda duh. I like to run my debugger in development mode.

The workaround is to downgrade Flask to 1.0.3 and werkzeug to 0.15.4 and Python<=3.7.
Note that werkzeug 0.15.4 has known incompatibility with Python 3.8.x. Python 3.7 and 3.6 are OK.
Intellij seems to be laissez-faire about this issue and its still open. It affects both Professional and Community editions. See here:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004300599-Debugging-a-flask-app-fails
and the actual ticket here:
https://youtrack.jetbrains.com/issue/PY-36445#focus=streamItem-27-3602876.0-0
Finally, there are some legacy exports that you might come across in older code. Even stuff like app.run() instead of ‘flask run‘. This excellent stackoverflow post discusses that: https://stackoverflow.com/questions/17309889/how-to-debug-a-flask-app
As a bonus that link also deals with how to setup pdb (python command-line debugger). I often use this when debugging my tests in pytest.
Free
Supported in Professional and Community Editions
- Package management
- PyGTK
- PyQt
- Python console
- reStructuredText support
- Virtualenv/Buildout
- Cython
- Duplicate code detection
- Python profiler
- UML Diagrams
Free
Supported in Professional and Community Editions
- Package management
- PyGTK
- PyQt
- Python console
- reStructuredText support
- Virtualenv/Buildout
- IntelliLang
- Keyboard-centric navigation
- Local terminal
- Task management
- TextMate bundles
- .po files support
- BDD support
- File watchers
- Profiler integration
- Puppet
- REST Client
- Thread Concurrency Visualization
Free
Supported in Professional and Community Editions
- IntelliLang
- Keyboard-centric navigation
- Local terminal
- Task management
- TextMate bundles
- CVS
- Git, GitHub
- Mercurial
- Subversion
- Perforce
Pycharm Community New Flask Project
Free
Supported in Professional and Community Editions
- CVS
- Git, GitHub
- Mercurial
- Subversion
- HTML, XML, YAML, JSON, RelaxNG
- Node.js
- React, React Native
- Angular, AngularJS
- Vue.js (Via plugin)
- *All functionality from WebStorm
Free
Supported in Professional and Community Editions
- HTML, XML, YAML, JSON, RelaxNG
- Google AppEngine
- Jinja2
- Mako
- web2py
- Kubernetes (via Plugin)
- *All functionality from DataGrip
- Conda Integration
- R Plugin (Via plugin)
Free
Supported in Professional and Community Editions
- Conda Integration
- Windows/MacOS/Linux
Free
Supported in Professional and Community Editions
- Windows/MacOS/Linux
- Commercial
Free
Community Vs Professional Pycharm
Supported in Professional and Community Editions
- Open-source, Apache 2.0
