Quickly Export Excel Files in Web Development (with Code)
· β˜• 3 min read
In web development you often run into the need to export data. This post mainly covers how to quickly export data and save it as an Excel file. 1. Frontend In web development, formatted data is usually displayed as a table. Below is an employee salary table; we will use

XSS Principles and Construction
· β˜• 6 min read
XSS is an attack technique that executes JavaScript in the frontend. With the popularity of UGC sites, the data generated by users has surged, and the ever-denser network of data blocks makes it easier to carry out and spread XSS. The damage XSS causes includes: stealing user cookies and personal information; hijacking sessions and manipulating users’ network data; launching DDoS attacks; tampering with pages, popping up ads, and so on.

The manage Command in Django
· β˜• 2 min read
Every Django project automatically generates a manage.py file. manage.py is a simple wrapper around django-admin; its job is to put the Django Project into the sys.path directory and set the DJANGO_SETTINGS_MODULE environment variable to the current Project’s settings.py file. In other words, the difference between django-admin and manage is that

Meta Options in Django Models
· β˜• 4 min read
Define metadata for a model through an inner class “class Meta”, like this: 1 2 3 4 class Foo(models.Model): bar = models.CharField(max_length=30) class Meta: #...... Model metadata means: any data that is not a field such as ordering options, admin options, and so on. Below are all the Meta options you might use.

Django Middleware
· β˜• 4 min read
1. __init__(self) In a middleware class, the __init__() method is used to perform system-wide initialization settings. For performance reasons, each enabled middleware is initialized only once per server process. That is, __init__() is called only when the server process starts, and is not executed while handling an individual request. For a middleware, the usual reason to define an __init__() method is to check whether it is needed at all.