Hi all,
This must be very simple, but I'm stumped.
Here's the code for views.py
from django.http import HttpResponse
import datetime
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
The offending line is:
now = datetime.datetime.now()
The code's cut and pasted from the Django 1.1 tutorial (http://
docs.djangoproject.com/en/1.1/topics/http/views/), and I have Django
1.1.1.
datetime.datetime.now() works as a function call at the Python shell:
>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2010, 2, 10, 5, 17, 21, 218000)
Any ideas? Thanks,
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.