Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Build a Social Network with Flask Tacocat Challenge Tacocat!

Sam Dale
Sam Dale
6,136 Points

Landing Page for Tacocat

Hi there. I was just wondering if there is supposed to be a landing page for the tacocat project. (i.e. an app.route("/") that redirects to something like landing.html). It's necessary to have a route for "/", but neither index.html nor taco.html seem to meet all of the qualifications that are needed in the app tester. I added a landing.html:

{% extends "layout.html" %}

{% block content %}
<ul>
    <li><a href="#">Add a new taco</a></li>
    <li><a href="#">No tacos yet</a></li>
    <li><a href="{{url_for("register")}}">Sign Up</a></li>
    <li><a href="{{url_for("login")}}">Log in</a></li>
    <li><a href="{{url_for("logout")}}">Log out</a></li>
</ul>
{% endblock %}

In it's simplicity to cover all of the required bases. Since there is no way to add an additional file when you submit the challenge, is there another way you should be doing it or should you just do the cheatsy way I saw on the forums which was to have app.route("/") just return "add a new taco</br>no tacos yet</br>sign up</br>log in</br>log out" Cheers!

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

I created a route for "/" to redirect to index:

# index
@app.route('/')
def index():
    tacos = models.Taco.select()
    return render_template('index.html', tacos=tacos)

Then make any necessary changes to index.html to pass remaining tests.