Sign in
There are a total of 2 posts.
2026-01-23
本文整理了在 Django 模板中取得目前 URL 的多種方法,對比 request.path、request.path_info、request.get_full_path() 與 request.build_absolute_uri() 的差異與使用情境,說明如何在菜單高亮、重定向、canonical URL 等場景中運用,並提醒部署環境下的注意事項。
2026-03-17
Django 開發者必讀!深入解析 django.utils.http 模組的核心功能。從使用 urlsafe_base64_encode 建立安全權杖,到利用 is_safe_url 防禦開放重新導向漏洞,以及高效構建查詢字串。立即掌握安全處理 HTTP 數據的實用程式碼範例與開發技巧,讓您的 Django 專案更加穩固。