flask过程中html文件显示Notfound,return render_template无法正确执行

请教~ 使用pycharm制作简单网页收集表单,一直提示,几个.html文件 notfound,表单填完之后也无法跳转到初始页面。
即 render_template('index.html')没有正确执行。

img

\n

img

  • 这有个类似的问题, 你可以参考下: https://ask.csdn.net/questions/7623492
  • 这篇博客你也可以参考下:flask 出现 TemplateNotFound的问题
  • 除此之外, 这篇博客: flask 微信扫码登录中的 index.html页面 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
    <h1>欢迎使用Web微信:{{init_user_dict.User.NickName}}</h1>
    
    <h3>最近联系人</h3>
    <ul>
        {% for row in init_user_dict.ContactList %}
        <li>{{row.NickName}}</li>
        {% endfor %}
        <li><a href="#">查看所有联系人</a></li>
    </ul>
    
    <h3>最近公众号</h3>
    {% for item in init_user_dict.MPSubscribeMsgList %}
    <div>
        <h3>{{item.NickName}}</h3>
        <ul>
            {% for msg in item.MPArticleList %}
            <li><a href="{{ msg.Url }}">{{msg.Title}}</a></li>
            {% endfor %}
        </ul>
    </div>
    {% endfor %}
    
    
    </body>
    </html>