Category: 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. ...
Continue Reading Custom Signals in Django

How to create REST APIs in Django

Django makes creating a REST API a breeze. We’ll walk you through the steps to get your first API up and operating in this tutorial. ...
Continue Reading How to create REST APIs in Django

How to create Custom mixins in Django

This article seeks to leverage Django’s mixins to create solid and flexible models. A mixin is a unique type of multiple inheritances. Mixins are typically employed in one of two scenarios: ...
Continue Reading How to create Custom mixins 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. ...
Continue Reading SingleObjectMixin 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. ...
Continue Reading TemplateView in Django

ListView in Django

Function-based Views Django, one of the core fundamentals is the ListView. Views can be implemented as Python objects instead of functions using class-based views. ...
Continue Reading ListView 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. ...
Continue Reading Model Formsets 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: ...
Continue Reading Template Tags in Django

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. ...
Continue Reading CI/CD Django using Travis-CI

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. ...
Continue Reading What are Mixins in Django