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…
Django 1.11 beta 1 released
51–60 of 87 posts
Re: Django 1.11 beta 1 released
#52Subquery 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.
Re: Django 1.11 beta 1 released
#53Earlier quoted context omitted.
I haven't followed this one myself, but the django girls tutorial is supposed to be excellent. https://tutorial.djangogirls.org/en/
I prefer djangogirls to two scoops - twoscoops is the way to go once you have learn the basics. But I felt it lacked a walkthru example
Re: Django 1.11 beta 1 released
#54This 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…
For someone completely new to Django I'd likely recommend Tango with Django or Hello Web App
Re: Django 1.11 beta 1 released
#55Earlier quoted context omitted.
I prefer djangogirls to two scoops - twoscoops is the way to go once you have learn the basics. But I felt it lacked a walkthru example
Two Scoops is a great book, but it is based around best practices, so assumes you know Django already to some extent.
Re: Django 1.11 beta 1 released
#56This 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.…
Also, a shameless plug, I have built a website[2] where I collect the best webdev learning resources, you can find other good Django tutorials there. Funny enough, the website itself is built based on the stuff I've learned from the Django Unchained course =)
Re: Django 1.11 beta 1 released
#57> The Django 1.11.x series is the last to support Python 2. The next major release, Django 2.0, will only support Python 3.5+. Really the most important part of this release, out of all. This is the time where enterprise companies using Python and Django really need to switch to Python 3. In fact, anyone using Ubuntu 16.04 should already find themselves going "ugh" because they needed Python 2. More reasons to push f…
It's reasonable that volunteer developers working on an open-source project sunset old versions, and old versions of language runtimes or dependencies. Nobody wants to keep maintaining 5-year-old versions with 12-year-old dependencies when they could use their time to improve the latest version instead.
Django is one of the most "responsible" projects in this regard - having LTS releases that are maintained for three years for free. Some projects even say "you should stick with github master" for fixes :)
But it's cool that Rails has a company providing paid enterprise support after the community support ends. Their pricing is surprisingly cheap - I would expect that if an enterprise has a legacy application that must be kept "stable" and never upgraded, then they would be willing to pay $10k and upwards per month for that privilege.
Re: Django 1.11 beta 1 released
#58Earlier quoted context omitted.
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.
Re: Django 1.11 beta 1 released
#59Earlier 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…
You may be interested in the `.extra(...)` call on a QuerySet in Django. It allows you to specify hand-written SQL for various clauses, including `WHERE`. https://docs.djangoproject.com/en/1.10/ref/models/querysets/...
Re: Django 1.11 beta 1 released
#60Earlier quoted context omitted.
> 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.
published_posts = Post.objects.filter(publish_date__gte=now())
post_count = published_posts.count()
You can't just append a COUNT to an SQL query, you'd have to write two queries, or one query that returned both. The above code produces two different queries, so it's much more composable.I use it for tacking on extra filtering terms as well:
if category:
published_posts = published_posts.filter(category=category)