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…
Django 1.11 beta 1 released
31–40 of 87 posts
Re: Django 1.11 beta 1 released
#32I 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
#33Earlier 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
Re: Django 1.11 beta 1 released
#34Subquery 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.
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
#35Earlier 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
Re: Django 1.11 beta 1 released
#36Re: Django 1.11 beta 1 released
#37I'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…
Why don't you just try it?
Re: Django 1.11 beta 1 released
#38Earlier 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.
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
#39Re: Django 1.11 beta 1 released
#40I'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?