Custom Signals in Django

Custom Signals in Django

Django comes with many features out of the box, and they’re all ready to use and combat tested. But, on the other hand, Django signals are one of the most underappreciated out-of-the-box capabilities Django offers. Django Signals is a technique for notifying detached applications when particular events occur. ...
SingleObjectMixin in Django

SingleObjectMixin in Django

Many capabilities are built-in to Django’s class-based view, but you may need to use some of them individually. You could want to construct a view that renders a template for an HTTP response, but you can’t use TemplateView; Maybe you need to render the template POST on it and get the GET to accomplish what you want. ...
TemplateView in Django

TemplateView in Django

A view is a callable that receives a request and responds. Django gives an example of several classes you can use like views, so this can be more than just a function. You may arrange your views and reuse code by utilizing inheritance and mixins. ...
Model Formsets in Django

Model Formsets in Django

ModelFormsets are a more advanced approach of dealing with numerous forms built using a model and using them to construct model instances in Django. In other words, ModelFormsets are a collection of Django forms. For example, you might want to create many forms on a single page, each of which may require multiple POST requests. ...
Template Tags in Django

Template Tags in Django

Django Web Framework includes many tags used to create arbitrary logic in the template. Tags are used in the rendering process to give arbitrary logic. A tag can, for example, print material, act as a control structure (e.g., an “if” statement or a “for” loop), retrieve content from a database, or even give other template tags access. Tags are formatted as follows: ...
CI/CD Django using Travis-CI

CI/CD Django using Travis-CI

If you want to save time testing your Python code in many settings before publishing/deploying your packages automatically, creating CI/CD pipelines is a beautiful way to go. It’s also an excellent approach to catch bugs early and guarantee that your development process is consistent and repeatable. ...
What are Mixins in Django

What are Mixins in Django

When you mix generic views with Mixins, their true power emerges. A mixin is another class you create and whose methods your view class can inherit. Assume you want the additional variable ‘page_title’ in the template to appear in every view. You create a mixin using this method and let your views inherit instead of overriding the get_context_data method each time you develop the view. ...