CM Cheng Notes
HomeArchivesCategoriesTags
2022-10-31發表Django幾秒讀完 (大約51個字)

(Django)取得目前URL/app_name

1
2
3
4
5
6
7
8
from django.urls import resolve

def get_current_url(request):
...
current_url = resolve(request.path_info).url_name
app_name = resolve(request.path_info).app_name
print("current_url: %s" % current_url)
print("app_name: %s" % app_name)

在template取得app_name

1
{{request.resolver_match.app_name}}
#Django
Markdown基礎語法整理
(MSSQL)Reducing LDF file size
CM Cheng

CM Cheng

Taiwan

文章

51

分類

14

標籤

36

最新文章

2024-04-29

(Python) Pandas的loc與iloc用法

Python

2024-04-02

mssql-collation-conflict

MSSQL

2024-01-30

(linux)Vim存檔無root權限,不用離開Vim的臨時解決方法

Linux

2024-01-29

(GAS)getRange與getDataRange差異

Google Apps Script(GAS)

2023-12-22

(Windows)使用微軟官方工具,解決軟體無法安裝或移除問題

Windows

分類

  • Apache3
  • Django3
  • Google Apps Script(GAS)1
  • Hexo4
  • IIS2
  • Linux2
  • MSSQL13
  • Markdown1
  • MySQL1
  • Perl1
  • PowerShell6
  • Python6
  • SAP3
  • Windows5

標籤

11751
4041
ABAP3
Apache3
CMD2
DBCC CHECKIDENT1
Django3
GitHub1
Google Apps Script(GAS)1
HSTS1
HTTPS1
Hexo4
ICARUS2
IIS3
INSERT INTO FROM1
Linux2
MSSQL13
Markdown1
MySQL1
PIVOT1
Perl1
PowerShell7
Python6
SAP3
SELECT INTO SELECT1
SSL1
SSMS2
Safe Update Mode1
Windows12
XPS檢視器1
htaccess1
pandas2
pip1
restoring1
special variables1
爬蟲2
CM Cheng Notes

© 2024 CM Cheng  Powered by Hexo & Icarus

×