Django 1.4 final released
djangoproject.com
djangoproject.com
Some things to really dig:
* better password hashing (bcrypt, etc...)
* time zone support
* built in selenium testing support
* bulk insert Models
* prefetch_related() (efficiently join m2m)
* SELECT FOR UPDATE support
* easy signing of cookies
* better project templates (basic scaffolding)
There are lots more... big release. Thanks to the all folks behind it. * *args and **kwargs support for template tag helper functionshttp://amccloud.com/post/14689947527/django-1-4-custom-proje...
Does anybody have any reference to the scaffolding features? This might be the first I've heard of it.
Yeah, see https://docs.djangoproject.com/en/1.4/ref/django-admin/#djan... and https://docs.djangoproject.com/en/1.4/ref/django-admin/#djan....
It's really very simple: you just create a directory of files and point startproject/startapp to that directory with the --template flag. Files are copied over into the new app/project, with some simple replacements for things like the project name.
You can check out Django's source for the built-in one, or if you poke around on Github you'll find some others. Here's one, for example: https://github.com/amccloud/django-project-skel/.
* The if template tag now supports {% elif %} clauses.I don't like this because a lot of us put validation logic in Model#save and use the signals to trigger the search indexer, and so forth. This behavior is definitely going to catch some people off guard and it's bound to lead to serious bugs.
I understand why they don't call Model#save for every object, but I think they should have introduced something like Model#validate which is called before every save (including the new bulk inserts) so you still get a place to put custom validation logic that you know will get called the moment something is placed in the database. So now inserts are faster but at the expense of correctness. I'm not convinced that's a good trade off.
Oh, and for some reason bulk updates are completely missing, even though it seems natural to add bulk_insert and bulk_update at the same time.
When processing bulk data sets you can iterate over calling your own validation then perform bulk insert knowing its validating. And your save will still validate as before.
https://docs.djangoproject.com/en/dev/topics/db/queries/#upd...
Check it out: https://github.com/xenith/django-base-template
or just..
django-admin.py startproject --template https://github.com/xenith/django-base-template/zipball/master --extension py,md projectname django-admin.py startproject --template https://github.com/amccloud/django-project-skel/zipball/master --extension py,md yourprojectnameIf you have any MVC framework experience at all django is relatively straightforward.
I'd recommend skimming through a few Django applications to get an idea of structure, one I know off the top of my head (as I wrote it): https://github.com/zapier/django-knowledge
Read the excellent Yipit Django blog (http://tech.yipit.com/). Especially their post about learning Django: http://tech.yipit.com/2012/02/28/183772464/
Introduction to Django http://pyvideo.org/video/604/introduction-to-django
and if you want to venture further down the rabbit hole
Django in Depth http://pyvideo.org/video/610/django-in-depth
I don't agree that the documentation is great, but it is definitely good, although it is frustratingly lacking in some areas - although you won't run into that soon.
My suggestion is to try it in this order:
1. Django Book
2. Django Project Intro[1]
3. Django by Example[2]
The best tip to learning Django is to use #django on freenode[3]. People there will not do your work for you, but interactive live help is simply the best there is, unless you know forums like Something Awful where you can write out long-form questions to people who'll respond in the same fashion.
EDIT: I seriously wouldn't bother with any of the Django (book) books out there.
[1]: https://docs.djangoproject.com/en/dev/intro/
In short, if your Python skills are passable, I'd say the docs at djangoproject.com[1] are more than sufficient. If not, I'd guess you might have troubles.
I should probably also point out that I'd only dealt with web languages before that point (PHP, ASP Classic, etc), so that's probably a negative point for me.
Everybody's different, for sure. For me, my Django suffered until I understood Python.
Can I ask what your pre-Django experience was? I wonder if there's any significance.
To be honest, I suspect my Python's not great - I probably ought to spend more time just writing Python - I'd hazard a guess that less than 20% of the time I spend building websites with Django is spent writing Python (most is probably spent fiddling around with HTML/JS). I can always get by - but every once in a while I learn something new that I wish I'd known about long before (I remember learning about list comprehensions at an intro to Python talk at Stack Overflow DevDays after I'd been using Python for about a year!).
django-registration
django-secure2. Run the test suite of the apps.
3. Run the apps with v1.4 and warnings turned on via:
python -Wall manage.py runserver.
Not only will you quickly see what's broken, but Django will dump helpful deprecation warnings for things that will eventually break at some point.I am glad sqlalchemy deals with sql-only databases.
You don't need an ORM for nosql. A library suffice.
Well, people don't need all the features all the time.
Else, they would use Oracle and not MongoDB.
In the same logic, they get by with Django ORM just fine.
As for the complexity, I don't think anyone ever called it complex...