开发者

Django request_finished signal

How to use request_started signal in djan开发者_开发百科go? I want to execute some commands before processing a http request or do django have a callback similar with rails before_filter?

Thanks


Consider writing your own middleware instead.


According to this doc you may use:

from django.core.signals import request_finished
from django.dispatch import receiver

@receiver(request_finished)
def my_callback(sender, **kwargs):
    # process
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜