首页›Adam Johnson›文章

Django: introducing django-launch-editor for jump-to-file debugging

Adam Johnson · 2026年11月8日

AI 摘要 AI 生成,可能有误

作者介绍了 django-launch-editor,这是一个新包,能把 Django 调试错误页面上的文件位置变成可点击的链接,直接在正确的行和列打开你的编辑器,省去了手动复制路径的麻烦。它构建于 launch-editor-py 之上——这是 npm 的 launch-editor 包的 Python 移植版(主要在 LLM 辅助下创建),能检测你正在运行的编辑器并了解其命令行语法——其灵感来自作者的 profiling-explorer 工具中新增的类似功能。设置只需安装该包、设置 DEFAULT_EXCEPTION_REPORTER 并添加其 URL 即可,在生产环境中零开销;如果编辑器不在同一台机器上(例如 Docker 或远程服务器),它会退而求其次,把位置复制到剪贴板。

I’ve made another package! django-launch-editor makes the file locations on Django’s debug error page into links that open your editor.

Here’s how it looks, on a KeyError from the package’s example project:

(Click to enlarge.)

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Adam Johnson

Django-related Deals for Black Friday 2026

AI 摘要This article rounds up Django-related Black Friday and Cyber Monday deals, including 50% discounts on the author's 'Boost Your DX' books, Aidas Bendoraitis' paid Django packages, the book Django in Action from Manning, Cory Zue's SaaS Pegasus, and Talk Python's Everything Bundle. It also mentions 25% off pre-orders of Django 6 By Example and encourages readers to support the Django Software Foundation through donations or corporate sponsorship.

Zsh: measure command durations with the time command, TIMEFMT, and REPORTTIME

AI 摘要This article explains Zsh's built-in `time` command, which reports user/system CPU time, CPU percentage, and elapsed wall-clock time for a command or pipeline, and notes that subshells are needed to time multiple commands or brace groups. It also covers the TIMEFMT parameter for customizing output—including statistics like maximum memory usage and microsecond precision—and the REPORTTIME setting, which automatically prints timing statistics for any command whose CPU time exceeds a specified threshold.

Zsh: glob case-insensitively with the (#i) glob flag and the no_case_glob option

AI 摘要Zsh globs are case-sensitive by default, but you can make an individual glob case-insensitive by using the (#i) glob flag, which requires enabling the extended_glob option. To make all globs case-insensitive globally, you can enable the no_case_glob option in your ~/.zshrc. Additionally, the case_paths option can be turned on if you want literal directory names to remain case-sensitive while globs match case-insensitively.

Zsh: uncover hidden files in globs with (D)

AI 摘要Zsh globs skip hidden dotfiles by default, but adding the (D) glob qualifier includes them, which is especially useful for recursive globs like **/*.yml(D) to find files inside hidden directories. The glob_dots option in ~/.zshrc can make globs always include hidden files (with (^D) available to exclude them), while patterns starting with a dot list only hidden files. Zsh never matches the special . and .. entries in any of these cases.

Zsh: parse command-line options with zparseopts

AI 摘要The article explains how to use Zsh's zparseopts builtin to parse command-line options in shell scripts, handling both short and long options in a single line of declarations. It demonstrates key features through examples: declaring options with name=array specifications, using flags like -D (remove parsed options from arguments), -E (allow options anywhere), and -F (fail on unknown options), as well as options that take arguments (with :) or accumulate repeats (with +). It also notes limitations, such as the lack of built-in support for the --option=value syntax, which requires manual stripping of the equals sign.