How can I use object-oriented programming in order to better structure my code in Django? I am interested in an example.
The most vivid and common example is the class-based views in Django. Try to use them instead of view functions.
With OOP, it is possible to define the base class, and then inherit its data/methods by the subclasses. This makes your code more concise and clear. The example: you may often need to check if the user is logged in or whether he/she has permission to visit the page. It can be done with the UserPassesTestMixin, which you can inherit by all classes where you want to implement such behaviour. Moreover, if the logic is the same for more than one views, you can create a base class where the logic will be coded, and then just inherit this logic in all the needed views.