파이썬 코드가 아닙니다 :jinja2 템플릿을 발견하고 내부 서버 오류
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def hello():
return render_template('testing.html')
if __name__ == "__main__":
app.run()
HTML 파일 : pycharm 커뮤니티 버전 jinja2을 사용하도록 설정하는 방법 또한
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>My name is pk</h1>
</body>
</html>
합니다. 내가 직접 당신이 이미 플라스크 패키지를 다운로드 한 경우
또한|-app
|--templates // where your html files must be in
|--static // where your js and css files must be in
|--.py files
|--other packages
신사는, 시스템에 설정되어 같은 프로젝트
전체 오류와 파일 및 디렉토리 구조를 표시 할 수 있습니까? – coralvanda
'testing.html'파일이 templates 폴더에 있는지 확인하십시오. 앱 구조를 보여줄 수 있다면 더 좋습니다. – thangtn
@coralvanda 아래에 언급 된 전략을 사용하여 솔루션을 얻었습니다. 고마워, 내 질문에 계속 대답 해줘. – pk786