我在我的django項目中寫了一個信號,裏面我想發送一封電子郵件和我的網站的完整路徑。但是爲了做到這一點,我需要在信號中獲取請求對象,我怎麼能這樣做呢?謝謝。Django信號獲取請求完整路徑
@receiver(pre_save, sender=AccessRequest)
def email_if_access_true(sender, instance, **kwargs):
#How can I get the full path of my website here?
pass
wrt/SITE_ID = 1:也就是說,除非您真的使用網站框架來爲同一個項目中的多個網站提供服務;) – 2013-03-20 10:37:20