I
I
I love Sprats2021-07-05 15:29:01
PyCharm
I love Sprats, 2021-07-05 15:29:01

How to make Run config in PyCharm for Flask using Pipenv?

I created a project where I use pipenv, then I installed flask itself. Through the terminal, all the rules come out

pipenv run flask run

. But with the config for launching, I got confused. Is it possible to do everything through a shell script?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
I love Sprats, 2021-07-05
@makememesnotwar

In general, the best and most normal option is to create a file and build on it.

# run.py
from app import create_app

if __name__ == '__main__':
    app = create_app().run()

# app/__init__.py
from flask import Flask


def create_app():
    app = Flask(__name__)
    app.config.from_object('app.config')

    return app

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question