Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask 404 eroor
#1
I am new to pythond and flask.. I downloade pycharm and trying to do a simple web app, when I try to opne an html page fron index always get 404 error the server has not this page. Two days now searching and tried all options. Wish any one can help me as soon as possible I am stuck. What is the issue???????
Screen shots attached
from flask import Flask, render_template
app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/loginnew')
def loginnew():
    return render_template('loginnew.html')


if __name__ == '__main__':
    app.run(debug=True)
Output:
127.0.0.1 - - [12/Oct/2021 12:35:52] "GET /loginnew.html HTTP/1.1" 404 -

Attached Files

Thumbnail(s)
           
Reply
#2
You should post code and not images,if had eg GitHub could clone all down easy.
Look at this post so about.html will be same as your loginnew.html.
Also if new so doing all PyCharm can be confusing,learn to use command line eg make folder files and test outside of PyCharm.
Can still use PyCharm to watch files,but learing command line is very important.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020