Learning
Same-Origin Policy and Cross-Origin Access
· β˜• 2 min read
1. Same-Origin Policy The same-origin policy is the cornerstone of browser security. The definition of same-origin covers three aspects: Same protocol Same domain Same port Scope of the restrictions: Cookie, LocalStorage, and IndexDB cannot be read The DOM cannot be obtained AJAX requests cannot be sent Simply put, two URLs whose protocol, domain, and port differ in any way are not allowed to communicate with each other, and the scope covers reading each other’s cookies and DOM and sending AJAX requests.

Linux Performance Command Tools
· β˜• 1 min read
There are many performance tools on the Linux platform, enough to make your head spin, but long-term exploration and experience have shown that the most useful ones are still those time-tested, simple little utilities. Below are the command-line tools collected from system performance expert Brendan D. Gregg’s talk on Linux performance (Linux Performance Tools).

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.

Introduction to the Django Standard Library
· β˜• 3 min read
Django’s standard library lives in the django.contrib package. Each subpackage is a standalone add-on feature package. These subpackages are generally independent of one another, though some django.contrib subpackages depend on other subpackages. There is no hard requirement on the kinds of functions in django.contrib. Some of these packages ship with models (and therefore require you to install the corresponding database tables), while others consist of standalone middleware and template tags.

Reading and Writing Excel with Python
· β˜• 2 min read
Python and Excel are both commonly used for data processing, so passing data back and forth and handling computations between them is unavoidable. This article mainly introduces the Python-Excel family of libraries, and how to use the xlrd and xlwt libraries. 1. Common Libraries xlwings, openpyxl, pandas, win32com, xlsxwriter, DataNitro,