Forums

html command dont run

Hello everybody. The lines of code below work on my localhost but not on pythonanywhere. Why does it happen? Here's code below:

 {% for post in posts %}
    <div>
        <p>publicado em: {{ post.published.date }} </p>
        <h2> <a href="">{{ post.title }}</a></h2>
        <p>{{ post.text|linebreaksbr}}</p>
    </div>
    {% endfor %}

The import was successfully performed directly from github to pythonanywhere. I checked and it's all there.

I assume it's a part of a web app code, right? Have you checked the error log yet?

Thanks for the answer.

Yes, you are correct. It is part of the app code. The part that doesn't run.

Yes, I also checked the error log and there is no error related to the question. The application runs as if it was working 100% but this line of code, responsible for making the posts appear in the HTML, doesn't work in pythonanywhere but it works without problem on my localhost.

Any suggestion?

If you're not seeing those entries in the html that is generated, then the most likely cause is that there are no posts in the posts list/queryset. Check that you actually have posts that should be shown.