訪問設定

完成所有設定後,你將需要在程式碼中使用它們。為此,請將以下匯入新增到你的檔案中:

from django.conf import settings

然後,你可以將你的設定作為 settings 模組的屬性進行訪問,例如:

if not settings.DEBUG:
    email_user(user, message)