The first is the datetime module. The second is a class.
It comes down to how you import it. These two bits of code are equivalent:
# Example 1
import datetime; print datetime.datetime.now()
# Example 2
from datetime import datetime; print datetime.now()
I generally prefer "import FOO" over "from FOO import BAR", which is why you see example 1 used in the Django Book.