这段代码无法执行:
def hours_ahead(request, offset):
try:
offset = int(offset)
except ValueError:
raise Http404()
dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
html = "<html><body>In %s hour(s), it will be %s.</body></html>" % (offset, dt)
return HttpResponse(html)
它返回此错误消息:
hours_ahead() missing 1 required positional argument: 'offset'
我安装了 Python 3.3。我在这里有什么遗漏吗?