Python

Matthew Starkey
PRO
Matthew Starkey
Pro Student 3,157 Points

Downloaded course files and seeing 404 error.

I have downloaded the flask course files for stage 3 start(bear builder). I have added the app.py file and coded the basic route for the index.html file. However when I run the file I get 404 error with method not allowed.

from flask import Flask
from flask import render_template

app = Flask(__name__)


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


if __name__ == '__main__':
    app.run(debug=True, port=8000, host='localhost')
Matthew Starkey
Matthew Starkey
Pro Student 3,157 Points

The index.html file looks like this as well.

{% extends "layout.html" %}
{% block content %}
<!--Enter Name -->
<div class="enter-name">
    <div class="grid-100">
        <img src="/static/img/bear_avatar.svg" class="bear-avatar" />
    </div>
    <div class="grid-100">
        <form action="" method="POST">
            <label>Name your bear</label>
            <input type="text" name="name" value="" autofocus>
            <input type="submit" value="Let's build it!">
        </form>
    </div>
</div>
{% endblock %}