i am new in Django. I have task , i have Horoscope website , there is 12 Zodiac signs Aquarius,Aries and etc.... In Aquarius.html
are subcategory like Aquarius love , Aquarius finance .... Template is similar, when visitor click love button i want to show love content of Aquarius ( i do not want to copy paste Aquarius.html
and create another love file and then show) how can do this?
For example when user open Aquarius i want to show
{% for aqua in aquas %}
{% if forloop.last %}
Aqua Content text{{aqua.body_text}}
{% endif %}
{% endfor %}
When open Aquarius Love (click love button) show Love content
{% for Love in Loves %}
{% if forloop.last %}
love Content text {{aqua.love_body_text}}
{% endif %}
{% endfor %}
how can do this? if else ?
I think your model like this:
Your Url maybe like this:
I think your view like this :
and your html file ZodiacSign.html. If i correctly understand you, you need only one html file which name is ZodiacSign.html :