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
精彩评论