You want something like this:
# Near the top of views.py
from datetime import datetime
# ...
currentMonth = datetime.now().strftime('%B')
return render_to_response('showroom.html',{'currentMonth':currentMonth,} , context_instance=RequestContext(request))
In the code you have in your comment above:
import datetime
currentMonth = datetime.now().month
currentMonthn = currentMonth.strftime("%B")
currentMonth
is an integer, and does not have the strftime
method, but datetime.now()
returns an object that does:
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> datetime.now().strftime('%B')
'December'
>>>