B
B
B1ackGh0st2018-05-24 02:23:29
Python
B1ackGh0st, 2018-05-24 02:23:29

Why does the program exit on Process finished with exit code 0?

Good afternoon.
I'm trying to learn Flask, but at the very beginning I ran into a problem: the web server does not rise and the program ends with Process finished with exit code 0
config.py

class Configuration(object):
    EDBUG = True

app,py
import sys
from flask import Flask
from config import Configuration

app = Flask(__name__)
app.config.from_object(Configuration)

main.py
from app import app
from view import view

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

view.py
from app import app
from flask import render_template

@app.route('/')
def index():
    return render_template('base.html', name='username')

base.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <h2>{{ name }}</h2>
</body>
</html>

I work through PyCharm, Flask connected

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav, 2018-05-24
@B1ackGh0st

It looks like it is running the wrong file (not main.py), you need to check that PyCharm is running the correct file in the configuration.
Run -> Edit Configuration... -> Script Path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question