Forums

First app. Can't find template.

Hello everyone. I am trying to deploy my first blog/app on PA for the first time without success. I followed closely the instructions to deploy in the Tango with Django book. The error I am getting is "Template does not exist at /" with the templates in question being blog.html and blog/post_list.html. I am using a virtual environment with django 1.6.2 and python 2.7.5.

I've tried various things and any help would be greatly appreciated.

Url in question: http://dcarrot2.pythonanywhere.com/

Thanks

Would you mind if we took a look at your files? It might make it easier to work out what's going on.

Yeah sure. Is there a setting I need to turn on in order to do that?

Nope, you don't need to do anything -- we just need your verbal permission. Looking into it now...

Ah, actually, I'd not parsed the error message properly. It's not looking for the templates called blog.html and blog/post_list.html -- it's looking for one template with the name blog.html, blog/post_list.html -- that is, a single file with a name comprising both filenames separated by a comma and a space.

I'm still not sure where the code that's causing that is. I'll keep looking, but I'm posting it here just in case you know right away :-)

OK, one problem I can see is that your filenames have inconsistent cases. In the templates directory you have a template called Blog.html but in the code you're referring to it as blog.html. This will only work on Windows. It's possible that the confusing error messages are coming from that. So if you rename the files in templates to be all lower case, then reload the web app, hopefully things will work -- or at least the error messages will become clearer!

I changed the file names to lowercase and it worked! Thank you so much!

Excellent, thanks for confirming that!