I had a problem with the Django tutorial so I asked a question here. No-one knew the answer, but I eventually figured it out with help from Robert. Python seems to be trea
"My question is: Why is datetime in my namespace without me using from datetime import *."
Because you did import datetime. Then you have datetime in your namespace. Not the CLASS datetime, but the MODULE.
Python does not treat import datetime
the same way as from datetime import *
. Stop asking why it does that, when it does not.
>>> import datetime
>>> date.today()
Traceback (most recent call last):
File "", line 1, in
NameError: name 'date' is not defined
>>>
There is something else happening. If it's Django magic or not, I don't know. I don't have a Django installation where I can try this at the moment. (If there is a super-quick way of making that happen, tell me. easy_installing Django wasn't enough. :) )