Forums

Template not working

The Template is not working on web, but works on my localhost. I am using Django. The homepage is empty with content on the web but on local host it does work as expected

There's not much to go on there, but my guess is that the content you're looking for is in a database that is on your local machine and not on PythonAnywhere.

i have added the data from admin account of site, and the data is visible in it too. But doesn't display here.

Can I take a look at your code? We can see it from our admin interface, but we always ask for permission first.

Yeah. I will be very much thankful

Thanks! I've taken a look. If you're seeing the posts on your localhost, I think you must have different code there. In your view function that's rendering the front page, you have this code:

return render(request, 'blog/post_list.html', {})

That isn't passing any posts for the template to use when it's rendering the page.