Answer the question
In order to leave comments, you need to log in
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
import sys
from flask import Flask
from config import Configuration
app = Flask(__name__)
app.config.from_object(Configuration)
from app import app
from view import view
if __name__ == '__main__':
app.run()
from app import app
from flask import render_template
@app.route('/')
def index():
return render_template('base.html', name='username')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h2>{{ name }}</h2>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question