I have a Django app that works great on localhost. When deployed the Heroku, for some reason the app returns different HTMLs. A few examples:
- I have a form with button type submit. This is the template
<button type="button" page="{{request.resolver_match.view_name}}" type="submit" id="bullets_submit"
class="btn btn-primary px-5 py-2">
Next Step
</button>
In localhost everything works well. But, on Heroku, the HTML I receive is without the type="submit"
. Same button just without this attribute.
- I have a for loop that iterates on a model and create a li
<div class="h5 mx-4 px-3 bg-white" style="position: absolute; top: -20px;">
About the role <a href="{% url 'app:responsibilities' description.pk %}" type="button" class="btn btn-outline-light px-2 text-muted border border-0"><i class="far fa-edit"></a></button>
</div>
<div class="border border-primary rounded shadow p-2 pt-3 m-2">
<ul>
{% for responsibility in description_responsibilities%}
<li>{{responsibility}}</li>
{% endfor %}
</ul>
</div>
On Heroku, even though the <i class="far fa-edit">
is clearly outside of the for loop, it still get generated several times in the HTML I receive from the server, as if it was inside the for loop.
Any idea what might cause this weird behavior? Or how I can debug it?
question from:
https://stackoverflow.com/questions/65875280/django-deployment-on-heroku-returns-different-html-than-local-host 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…