私は Django を発見しています。インデックス ビューの send_mail() 関数が 1 回は正常に機能するのに、インデックス ページをリロードすると機能しない理由がわかりません。
見る:
class IndexView(generic.ListView):
model = Quote
template_name = 'quotes/index.html'
context_object_name = 'quotes_list'
send_mail('Test Dj', 'Here is the message.', 'from@example.com',
['to@example'], fail_silently=False)
def get_queryset(self):
return Quote.objects.all()
初めてページをロードすると、すべてが機能し、メールが届きます。
その後、ページをリロードすると、2 通目のメールが届きません。