zsoldosp / django-currentuser

Conveniently store reference to request user on thread/db level.
BSD 3-Clause "New" or "Revised" License
157 stars 40 forks source link

Error getting user in settings.py #46

Closed seyikayode closed 3 years ago

seyikayode commented 3 years ago

I am trying to get the current user in settings.py but i am getting None.

belugame commented 3 years ago

settings.py is not a good place to use this as it is executed during startup of your application before any request would have been processed. There should not be any logic in your settings that depend on the current user. It should rather be in your view, your middleware, forms etc.

seyikayode commented 3 years ago

settings.py is not a good place to use this as it is executed during startup of your application before any request would have been processed. There should not be any logic in your settings that depend on the current user. It should rather be in your view, your middleware, forms etc.

Thanks