0

My .csv file is generating correctly and the form works but when I attempt to get an html output I generate a 404 URL not found error. Can you offer any guidance?

THe URL seems fine: http://956f859a-1035-468c-bc53-68ab7f9f943a-ide.cs50.xyz/registered

The route looks like:

@app.route("/sheet", methods=["GET"])
def get_sheet():
    #read the survey.csv file and send it to a ul on an html page.
        with open("survey.csv", "r") as file:
            reader = csv.reader(file)
            holidayTravel = list(reader)
        return render_template("registered.html", holidayTravel=holidayTravel)

and registered.html is nothing fancy

    {% extends "layout.html" %}

{% block body %}
    <h1>Submitted Itineraries</h1>
    <!-- build a list in a webpage ??? -->
    <ul>
        {% for travel in holidayTravel %}
            <li> {{holidayTravel[0]}}, {{holidayTravel[1] } will be {{holidayTravel[2]. They can be reached on a {{holidayTravel[4]}} at {{holidayTravel[3]}}</li>
        {% endfor %}

    </ul>

{% endblock %}
1
  • registered.html is located in survey/templates/registered.html
    – KayO133
    Commented Dec 7, 2019 at 0:42

1 Answer 1

0

I changed all instances of 'registered' to 'sheet' and that fixed the 404 error. Now I have to deal with the issue of data not showing in the sheet...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .