M
M
maxclax2015-03-23 18:19:14
Django
maxclax, 2015-03-23 18:19:14

How to pass request to a signal?

Tell me how to solve the issue: there is a user and logging model. When creating a user, it is necessary to fix logging with a signal, as well as when authorizing, disauthorization, fix logging. To fix logging, you need to get the user's IP and other data that can be obtained through request. When the signal fires, it does not contain request. How to shove it in there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey K, 2015-03-23
@mututunus

Track registration not through a signal, but through a registration view.

U
un1t, 2015-03-23
@un1t

Well, if you are absolutely sure that you need to use request from a place where it is not passed, then you can use this middleware: https
://github.com/jedie/django-tools/blob/master/...
Once again, perhaps there is a more elegant way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question