Creating year dropdown in Django template
I would suggest to use Javascript or jQuery at client side to populate the dropdown according to the current year.
I want to create a year dropdown in django template. The dropdown would contain start year as 2011, and end year should be 5 years from current year.
For ex: If today i see the dropdwon it will show me years ranging from 2011, 2012, 2013,...2017.
It can be done by sending a list from views.py and looping it in the template or defining inside forms.py.
But i don't want to use any form here. I just have to show it in a template.
How can i do it in Django template.