middleware py class ConnectSignalRecieve rsMiddleware def process_requ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# middleware.py
class ConnectSignalRecieversMiddleware:
def process_request(self, request):
for app in get_applist():
try:
app.connect_signal_recievers()
except AttributeError:
pass
# app.__init__.py
def connect_signal_recievers():
def delete_cache():
cache.delete('blah_blah')
dispatcher.connect(delete_cache, signal=signals.user_registered)