Oh good. It's not finished yet. I was afraid that I was going to have to buy it again when I hadn't finished the first edition. Apparently they can write faster than I can read.
I am really glad to see that they are updating it for Django 1.x. I have not programming background but have been trying to decide on a web-focused language/framework to learn, and Django was highest on my list. Up until now, however, there weren't any online resources (that I had found) that detailed getting started with Django 1.x. I've started looking at Ruby/Rails, but may have to reconsider my decision now that there is a good resource available.
Agreed, they're just 4 pages, but they cover a great deal and you can definitely start a decent site after going through the tutorial. At its end, it also points you to more docs that describe specific things such as forms, urls, and caching in great detail.
i still don't get the instantiation thing why datetime.datetime.now() ?? what's special about saying it twice? noob question but a link somewhere that explains this would be appreciated.
Basically, what it comes down to is Python's explicit over implicit policy. First, unlike PHP, not everything in the Python language is automatically included in every file. You explicitly import things. datetime is a module in the standard Python library. It includes several things: datetime, time, date, timedelta. . . So, often what you want is a datetime object from the datetime module, but you could do datetime.date.today().
One of the nice things about Python is that you should be able to see where something comes from anytime you're using it. If you're referencing something, it will either be defined in that file or be defined by something imported at the top. So, if you see "Site.objects.get_current()" you can easily search the file for where Site comes from. Maybe it's a Site class defined in the file itself. Maybe it's imported from django.contrib.sites.models. Maybe it's from somewhere else. The nice thing is that you can easily see where it comes from so that you can look up that code.
This is very unlike many languages. PHP's include()/require() could execute anything when you call them and define any number of things and you might not know where they come from so easily. I get push back on this from some of my friends who argue that good IDEs should track that for you, but I like that there isn't the ambiguity in Python.
Or it might have just been merged into the time module. The datetime module is mostly a single class which wraps the functions in the time module and adds a few convenience methods. I wouldn't be surprised if the reason for the separation is just historical -- say, time was written to match the C library, and later someone donated datetime as a set of utilities with an OO interface.
Anyway, since the common utilities in that are all attached to the datetime class in that module, there's no harm in importing the class directly. You could even fix the naming yourself, if you were so inclined:
from datetime import datetime as DateTime
DateTime.now()
It would make the datetime class look more like other class names, but I'd strongly recommend against doing this. The Python community values consistency in the way that code is written (TOOWTDI) and this would be a sharp departure from that.
Fair, but maybe some class renames wouldn't be a bad idea for the v2 to v3 switch over. I don't know what the priorities are or what the bar is for changes that make the cut, so don't quote me on this :-)
As others have mentioned, datetime is basically a module that deals with everything related to dates and times. datetime.datetime is a class that deals specifically with date and time combinations. So basically datetime.datetime.now() would return something that contained both the present date and time, while datetime.time deals with time objects.
Awesome! Djangobook.com and the official docs are how I learned Django. Djangobook.com is definitely a great place to start when then you can immerse yourself into the official docs (digging deep inside them) or the actual Django code, which can teach you a lot.
I tried making a simple Django app on Google app engine about 5 months ago, and I could never get it running. It left a bad taste in my mouth. Maybe it was just half baked on Google app engine at that time?