Live data from Hacker News

Django 1.11 beta 1 released

djangoproject.com

31–40 of 87 posts

Re: Django 1.11 beta 1 released

#31
post #22
post #18

This is a bit off topic, but can anyone suggest a decent Django tutorial? I've just recently learned python, and would like to build a few projects using Django. I completed Django's official tutorial[1], but when it came time for me to actually start building something, I found I didn't really understand what was going on. I should mention I'm inexperienced in both web application development and python in general.…

I highly recommend Two Scoops of Django and have recommended to every engineer at my company. The one caveat would be that the newest edition is for Django 1.8, so it'd be good to check against the docs periodically if anything looks off. Off the top of my head, the main thing I'd keep an eye out for would be changes to Class-Based Views like permissions mixins, although if I remember correctly, most of those changes…

Danny and Audrey are busy updating two-scoops for version 1.11, so if you can hold off on buying, do so, simply because 1.11 will be the next LTS release.

Re: Django 1.11 beta 1 released

#32
I've been building a project with Django Rest Framework (DRF), it's my first time using anything Django-related. Does anyone know whether new versions of Django tend to drop right into DRF, or whether DRF has to do some work to be compatible with a new version?

I ask because I like the sound of the fulltext search mentioned in another comment, because it would mean I don't have to install a search engine to support that feature. So I'd switch to Postgres and start using Beta 1 pretty soon, if DRF will just-work with it.

Re: Django 1.11 beta 1 released

#33

Earlier quoted context omitted.

Absolutely. The amount of "magic" Django does slowly became a real detractor for me. The way I define queries by using a custom language in the form of keyword arguments makes me wonder why I don't just learn SQL instead? I would much rather do something like: models.Foo.objects.filter(sql=my_sql_query_str) Instead of something like: models.Foo.objects.filter(name='bar', parent__siblings__count__lt=3) And no special…

> Just a string of SQL that I compose with Python string formatting sounds like an SQL injection waiting to happen

Hah!! So so true.

Re: Django 1.11 beta 1 released

#34
post #2

Subquery expressions looks like it would be just easier to write SQL, instead of going through the Django ORM. This is where SQL starts to show its expressive strength over ORMs.

Take a look at JinjaSQL - https://github.com/hashedin/jinjasql. Beyond a certain complexity, Django ORM gets in the way. Constructing SQL by hand is painful and can lead to SQL injection. And that's where JinjaSQL shines.

You write your query as a string template, and then jinjasql interpolates the variables and provides the bind parameters. Makes it easy to maintain complex queries.

Re: Django 1.11 beta 1 released

#35

Earlier quoted context omitted.

Absolutely. The amount of "magic" Django does slowly became a real detractor for me. The way I define queries by using a custom language in the form of keyword arguments makes me wonder why I don't just learn SQL instead? I would much rather do something like: models.Foo.objects.filter(sql=my_sql_query_str) Instead of something like: models.Foo.objects.filter(name='bar', parent__siblings__count__lt=3) And no special…

> Just a string of SQL that I compose with Python string formatting sounds like an SQL injection waiting to happen

I posted elsewhere on this thread, but take a look at JinjaSQL - https://github.com/hashedin/jinjasql. Let's you generate SQL from a string template without worrying about SQL injection.

Re: Django 1.11 beta 1 released

#37
post #32

I've been building a project with Django Rest Framework (DRF), it's my first time using anything Django-related. Does anyone know whether new versions of Django tend to drop right into DRF, or whether DRF has to do some work to be compatible with a new version? I ask because I like the sound of the fulltext search mentioned in another comment, because it would mean I don't have to install a search engine to support t…

I really don't mean this in as aggressive a way as it might read without this prefix but...

Why don't you just try it?

Re: Django 1.11 beta 1 released

#38

Earlier quoted context omitted.

Absolutely. The amount of "magic" Django does slowly became a real detractor for me. The way I define queries by using a custom language in the form of keyword arguments makes me wonder why I don't just learn SQL instead? I would much rather do something like: models.Foo.objects.filter(sql=my_sql_query_str) Instead of something like: models.Foo.objects.filter(name='bar', parent__siblings__count__lt=3) And no special…

> The way I define queries by using a custom language in the form of keyword arguments makes me wonder why I don't just learn SQL instead? You have to learn SQL to use the Django ORM anyways; it's required knowledge in order to be able to wield the higher level abstraction effectively. However, the way you write a lot of these things in SQL is substantially more verbose and harder to compose.

>"However, the way you write a lot of these things in SQL is substantially more verbose and harder to compose."

Could you give an example of something that's hard to compose with SQL? I'm sure ORMs have their advantages, I just want to understand how much benefit I could get from using one.

Re: Django 1.11 beta 1 released

#39
The new way of rendering form widgets is something I've been waiting for a long time. Now using custom form widgets like those in Bootstrap, or more complex fields like datepickers and the like should be as easy as dropping the HTML templates for those widgets in the proper folder, which is great.

Re: Django 1.11 beta 1 released

#40
post #32

I've been building a project with Django Rest Framework (DRF), it's my first time using anything Django-related. Does anyone know whether new versions of Django tend to drop right into DRF, or whether DRF has to do some work to be compatible with a new version? I ask because I like the sound of the fulltext search mentioned in another comment, because it would mean I don't have to install a search engine to support t…

I really don't mean this in as aggressive a way as it might read without this prefix but... Why don't you just try it?

I guess I could try grabbing the beta with pip, and I suppose there's probably some test suite for DRF that I could find and run. The thing I don't know for sure is that if the test suite passes then I'm good to go.
Post reply on HN