Posts
How to Package a Python Package and Upload It to PyPI
· β˜• 3 min read
Recently I have been thinking about how to improve development efficiency. From web crawlers to data processing, and then to artificial intelligence, Python’s strength lies in having a large set of out-of-the-box toolkits, so you do not have to reinvent the wheel, which greatly improves development efficiency. So why not modularize the functional pieces of a project and package them as reusable Python packages?

Django Debugging Tool django-debug-toolbar
· β˜• 3 min read
1. About Django’s Performance Django is a web application framework written in Python. With Django you can develop complex, data-driven websites very simply and efficiently. At the same time, Django pays close attention to component reusability, pluggability, agile development, and DRY (Don’t Repeat Yourself). To a certain extent, Django is an application framework very well suited to implementing business logic.

Controlling Static File Versions in Django
· β˜• 2 min read
To respond quickly to user needs and meet the requirements of marketing campaigns, internet products usually have a very high release frequency. Adopting agile development shortens the delivery cycle and speeds up product iteration, but it also brings challenges to a project’s file management. Frontend engineering faces users directly, bears

Django Static File Handling
· β˜• 3 min read
1. Categories of Django Static Files Django static files fall into two categories: static and media. static: files referenced by pages, such as JS, CSS, and images media: files uploaded by users 2. Production Environment Configuration In production, you usually configure Nginx to forward static file requests while Django handles dynamic requests.

Large File Transfer in Django
· β˜• 3 min read
1. Returning the File Directly If the static file is at media/test.zip in the project root, you first have to read the file into memory and then transfer it. The code looks like this: settings.py configuration 1 2 PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media/') yourapp/views.py 1 2 3 4 5 6 7 8 9 10 11 12 from django.