6 ms·
Django 1.4 final released
- bryanh 15y agoRelease notes here: https://docs.djangoproject.com/en/dev/releases/1.4/ https://docs.djangoproject.com/en/dev/releases/1.4/ 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.
- zalew 15y ago* *args and **kwargs support for template tag helper functions
- amccloud 15y agoI've created a project template that I consider - and hope - is an improved project template for most. http://amccloud.com/post/14689947527/django-1-4-custom-project-template http://amccloud.com/post/14689947527/django-1-4-custom-proje...
- bmelton 15y agoAll heavy hitting features. I've been begging for "SELECT FOR UPDATE" support forever, and django-bcrypt is in my bootstrap requirements.txt. Does anybody have any reference to the scaffolding features? This might be the first I've heard of it.
- jacobian 15y agoDoes 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/#django-admin-startapp https://docs.djangoproject.com/en/1.4/ref/django-admin/#djan... and https://docs.djangoproject.com/en/1.4/ref/django-admin/#django-admin-startproject 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/ https://github.com/amccloud/django-project-skel/.
- izak30 15y agoDjango-bcrypt should still be installed with those old projects while you upgrade. Be careful with that there are some gotchas
- trun 15y agoTime zone support! This has always been one of the most painful things to manage IMHO. Also this little gem caught my attention... * The if template tag now supports {% elif %} clauses.
- lightcatcher 15y agoI've found using Jinja2 templates (http://jinja.pocoo.org/docs/ http://jinja.pocoo.org/docs/ ) is a lot easier than dealing with the Django template language. Django also makes switching template languages quite easy.
- jawr 15y agoI believe Jinja2 is also a lot quicker, but the Django developers want to catch up.. so that's something.
- jd 15y agoIt's a great release, but bulk_insert is really really dangerous because it apparently doesn't call the save() method nor the pre_save or post_save signals. 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.
- ubernostrum 15y agoThis is the correct behavior, really. Bulk insert is not for cases where you have complex per-record validation or processing logic that also needs to be run in the application layer. It's for "I have all this data ready to go, now just shove it in there as efficiently as possible". If you need to have validation and additional per-record processing, signals, etc., insert the objects through the ORM normally. Yes, it'll be slower, but that's the price you pay for doing per-record processing.
- notyourwork 15y agoTo add to this, you could write your own validation method for a model and have your model's save method call this. 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.
- amccloud 15y agoBulk updating already exists. https://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once https://docs.djangoproject.com/en/dev/topics/db/queries/#upd...
- olofsj 15y agoAnother new thing you didn't mention is the new list filter framework for the admin. I've found it really useful in my projects.
- goggles99 15y agoCool, finally has what the big players have had for over 5 years (10 for some of the new features).
- RegEx 15y agoAny recommended resources on getting started with Django, or are the official docs sufficient?
- kat 15y agoOfficial docs are great, also check out the django book http://www.djangobook.com/ http://www.djangobook.com/
- ulucaydin 15y agoSadly the django book is very old and not updated since a long time.
- run4yourlives 15y agoThe official website is more than enough, so long as you have python experience. If not, you should start with Dive Into Python (or something similar) at the same time at least. If you have any MVC framework experience at all django is relatively straightforward.
- bryanh 15y agoOfficial docs are some of the best of any project (save maybe the best practices for view creation...). 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 https://github.com/zapier/django-knowledge Read the excellent Yipit Django blog (http://tech.yipit.com/ http://tech.yipit.com/). Especially their post about learning Django: http://tech.yipit.com/2012/02/28/183772464/ http://tech.yipit.com/2012/02/28/183772464/
- jonknee 15y agoThe official docs are outstanding, some of the best documentation of any open source project I have used.
- spdy 15y agoThe official docs are more than sufficient. They were one of the main reasons i picked up Django. Or you can watch the following: Introduction to Django http://pyvideo.org/video/604/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 http://pyvideo.org/video/610/django-in-depth
- Mizza 15y agoFor anybody interested in trying out the new templating system, this one has been active for a little while now and is based on the work of Mozilla and it has HTML5 boilterplate + Twitter bootstrap already, as well as Jinja2, Sphinx, Django-Admin-Panel, Markdown, Celery, South and some other niceties: Check it out: https://github.com/xenith/django-base-template 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
- amccloud 15y agoI made a template that I mentioned above that is a bit simpler and is self documenting. django-admin.py startproject --template https://github.com/amccloud/django-project-skel/zipball/master --extension py,md yourprojectname
- willy1234x1 15y agoI actually prefer yours over the prior one. It seemed a bit too packed for me, yours is loose enough in structure and allows me to customize on a per project basis more easily.
- ashconnor 15y agoIs the Django-Admin-Panel different than the default? I can't find a project page for anything named so.
- dougbarrett 15y agoMan, I just went through the 1.3 tutorial TWO days ago. Does anyone that uses Django know if the changes are huge? I guess I will be going through the 1.4 tutorial this afternoon.
- zalew 15y agohttps://docs.djangoproject.com/en/dev/releases/1.4/#backwards-incompatible-changes-in-1-4 https://docs.djangoproject.com/en/dev/releases/1.4/#backward...
- dougbarrett 15y agoThank you! Everything I read went over my head, which is good since it means I haven't gotten that far yet :)
- zalew 15y agogood for you, happy coding then ;)
- 5h 15y agoCongrats all, new project due to be live in a month or so I'll keeping an eye on updates and might make the jump asap
- kmfrk 15y agoDoes anyone know a good way to find out whether your Django packages will break or work fine? I am currently using these: django-registration django-secure
- mace 15y ago1. Check the docs and release history of the projects/apps; if they have not been updated prior to v1.3, it's likely to break with v1.4. 2. 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.
- halayli 15y agoI wish Django uses sqlalchemy as the default ORM instead of inventing a squared wheel.
- kennu 15y agoHow's SQLAlchemy working with MongoDB? I, for one, am very happy to be able to use MongoDB as a Django backend. I believe this is largely due to the fact that Django has never directly assumed data models to be stored in a SQL database, but has defined its own object abstraction layer instead.
- halayli 15y agoYou cannot have a sane ORM that works with nosql and sql databases without compromising features & complexity. I am glad sqlalchemy deals with sql-only databases. You don't need an ORM for nosql. A library suffice.
- batista 15y agoYou cannot have a sane ORM that works with nosql and sql databases without compromising features & complexity. 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...
- silent1mezzo 15y agoHere's a good list of changes http://procrastinatingdev.com/django/most-important-changes-in-django-1-4/ http://procrastinatingdev.com/django/most-important-changes-...
- melvinng 15y agoDamn, I just wasted 1 month rewriting a password hashing app.
- bmelton 15y agoHopefully not bcrypt, since dwaiter already has that one solved with django-bcrypt[1]. [1] - https://github.com/dwaiter/django-bcrypt https://github.com/dwaiter/django-bcrypt
- deleted 15y ago[deleted]
- himu11 15y ago[url=http://www.toyotacar-bd.tk]toyota http://www.toyotacar-bd.tk]toyota yaris[/url]
- BonoboBoner 15y agoDear prefetch_related(), my M2M-relationships have been waiting for you for soo long, glad you are finally with us.
- ineedtosleep 15y agoI have a Django app in its early stages using 1.3, would it be a good idea to just transfer it over to 1.4? The only third-party app that it is using is django-registration...
- joelhaasnoot 15y agoTry it and see - if you're not using virtualenv - you should be. If it doesn't seem compatible, just install 1.3 back.
- Tobu 15y agoI'm using a lot more (including django-registration) with 1.4, go ahead.
- gabrielgrant 15y agoThe main problems I ran into when upgrading were with the new timezone support, but it was easy to just disable it (set `USE_TZ = False`) until I have a real need for the feature (and the time to fix the issues it causes for current code).
- slig 15y agoI remember seeing that they would deprecate the {% url 'name' %} template tag without quotes. What happened to that?
- jtchang 15y agoCongrats to the team. Will have to check it out in the next few days.