Increase displaying time of django messages

后端 未结 1 671
深忆病人
深忆病人 2020-12-19 18:01

In my app, whenever a question is deleted, it shows a django message that question is deleted. Related code is:

from django.contrib import messages

msg= _(         


        
1条回答
  •  不思量自难忘°
    2020-12-19 18:50

    The thing you want to do is javascript domain. Below code will display your messages for 10 sec or you can close it manually. In template you can do like this:

    {% for message in messages %}
        
    {{ message }} ×
    {% endfor %}

    And in javascript:

    
    

    0 讨论(0)
提交回复
热议问题