Tag Django

Abstract class in Django model (abstract)

First, let’s introduce what attributes the django model has: Let’s look at an example first: The Meta of the Django model class is an internal class, which is used to define the behavior characteristics of some Django model classes. The following…

Database migration in django

Django is a web development framework written in python. Its characteristics are:   1. Heavyweight framework, with many functional components encapsulated inside, making development easier and faster,   2.MVT mode: front-end and back-end separation, high cohesion and low coupling, m: model, the…

Django Middleware Explained

What is Django middleware Middleware is a framework-level hook for handling requests (Requests) and responses (Responses) in Django, a lightweight, low-level plugin system for changing Django’s input and output globally. When a user performs an action in a website, the…

Introduction to Django templates

Preface There are a lot of templating systems on the market today, and the best known and used are DTL and Jinja2. DTL is an abbreviation of the three words Django Template Language, which is the template language that comes…

Django HttpResponse and JsonResponse

1. HttpResponse After the Django server receives the request sent by the client, it will encapsulate the submitted data into an HttpRequest object and pass it to the view function. Then the view function also needs to return a response…

Django time zone issues

We all know the time zone, the standard time zone is UTC time zone, Django uses UTC time zone by default, so the time we store in the database is UTC time, but when we make a website only for…

Django reverse function

The reverse function is used to reverse the URL, and then we introduce several uses of the reverse function. 1.Before, we used the URL to access the view function. Sometimes we know this view function, but want to reverse its…