Django in Depth
Why Stack Overflow recommends it
Stack Overflow users link it as an authoritative source on Django internals and best practice, often citing a timestamp, such as the advice on extending the User model or avoiding model inheritance.
Recommended by 1 people across 1 different months, 2012 to 2014.
What it is
A three-hour PyCon 2012 tutorial by James Bennett, a longtime Django core developer, that walks through how Django's main components work internally: the ORM, templates, HTTP request handling, views and the admin. It builds up from the bottom of the framework rather than showing a start-to-finish project.
What people said
Recommends Victor 'Chris' Cabral · 2012-08 · Stack Overflow · on “Extending the User model in django”
Dominique Guardiola is right. Use the AUTH_PROFILE_MODEL. James Bennett reiterated this in his 'Django in Depth' talk. [this video] around 1hr:37mins. Decide on the application where we want to house our user's profile, let's call it BngGangOfFour. Define a Model class, lets name it UserProfile for clarity, and give it the extra field(s) we desire. BngGangOfFour/models.py from django.contrib.auth.models import User class UserProfile(models.Model): user = models.OneToOneField(User) #notice it must contain a 1 to 1 field with the auth user. last_ip_address = models.CharField(max_length=20, default="") Edit settings.py to designate our newly created model as the user profile. settings.py .... AUTH_P
Cites MorphicPro · 2012-04 · Stack Overflow · on “Django | Advice for making models that are related with out model inheritances for a blog post type”
James Bennett for Django In Depth say that "He doesn't think db level inheritances is a good idea" as seen in [this video] at 1:29:20
Cites Andrey Nelubin · 2014-03 · Stack Overflow · on “Django AbstractUser Not Allowing Field Data To Be Saved”
Everytime you slicing queryset django get you new instance of in memory object foo = Employee.objects.all() foo[1] -> new instance foo[1].irc_name = 1234 -> new instance foo[1].save() print foo[1].irc_name -> will print u'' The best practice is to avoid slicing of queryset. You can find full answer in this video [this video] (binding to time)