I recently realized that class-based views are a beautiful, powerful tool to build clean, streamlined views that are easy to understand and maintain. Let me make my case with a trivial example. Let’s have a look at the canonical way to deal with a form in function-based views: What we have here is a good […]
At times, you need to perform some postprocessing after a view has been rendered. It could be some serious work, in which case you’d better arrange for it to be carried over by a separate thread, a separate process or even a separate server, or it could be just a quick update of the database. […]
In Django, when you create a relation using ForeignKey or a ManyToManyField, a corresponding backward relation is automatically created for you. This backward relation gets a reasonable default name. If you’d rather use a different name, you can specify one with the related_name parameter.