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!

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

Tacocat challenge. All test passed, but got a Try again error!!!

Hi everyone.

I attempt to pass the final «tacocat» challenge from «Build a Social Network with Flask» python course and got a Try again error on submission, the preview mode show me a 404 Page Not Found from nginx.

So as mentioned by Kenneth in the challenge presentation, if all test passed in the workspace, it should too in the https://github.com/guillaumemaka/tacocat_treehouse_challenge but in fact it didn't.

I don't post the code (too long) however you can find it here on github for reference

Quick summary all test from app_tests.py passed on the workspace provided by the course and on my laptop!

Hope that someone cam help me.

Best Regards.

Sorry for the block of text the forum doesn't respect my formatting even if the preview mode does!

[MOD: fixed formatting and GitHub link -cf]

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

I've cloned your repo and ran locally. Your local code ran successfully for me and all tests pass and I could view the site in a browser. On Treehouse, I also got the "Bummer!" and 404 Error when running your code in the challenge. When I tried your code in a workspace (See Launch Workspace on this video) using python tacocat.py, it would execute cleanly in the console, but when I went to preview it, the browser would display:

Workspace Unavailable

This is a preview link for a Treehouse Workspace that is not currently active.

My hypothesis is the error causing the Workspace not to function is the same error causing the Challenge to give the 404 error.

I compared my solution on GitHub. The difference is mostly style. I didn't see anything that would cause a failure.

I tried:

  • Adding 'is_admin', 'joined_at' to the User model
  • Change is_authenticated to is_authenticated(). (the workspace likes to have the parens due to flask version)
  • Added User.create_user call between the initialize() and the app.run call in tacocat.py

These differences didn't seem to matter. The issue seems to be limited to tacocat.py and models.py. When I overwrite these two files with my code, everything works.

Now it's a binary search to find out where along the migratory path from your code to mine the error will be fixed.

I'm open for more debug, but it will be another day.

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

Hi Chris,

Thanks for the detail response. I compared your code and mine and they are just minor difference (usually code style as you mentioned).

But for some obscur reasons after 1 hour submitting the challenge, it suddenly passed (I don't know why!!).

Again thank you for taking the time to answer me.

PS: For the workspace unavailable/active error, I got it too but notice that I forgot to run «python tacocat.py»