Get logged in to Django globally

1

All my models have relationship with User , and by default all my query_set will be made based on the user logged into the system. How would you do to get the user logged into any area of the app, for example the model , why will I create my objectManager to bring the query per user? >     

asked by anonymous 26.04.2017 / 19:25

2 answers

1

Does not solve your problem if in the views you use request.user when doing queries?

    
29.04.2017 / 08:24
1

You can use the request.user available in view that loads the page.

See more about using authentication and users at: link

If you want to know more about request.user in specific: link

    
03.05.2017 / 22:35