You may use sessions to get the logged in user as follows: request.session.get('_auth_user_id')
In your class you may pass the request as an argument.
i make a class in a py file in my django project. In this i need the logged in person's username. in views.py file, every function i pass request perameter, so that i could easily get the logged username. but in other py file i make a class, and there how can i get the logged user??? Thanks.
in class, i can not pass the request perametar. so i can not call requset.user. how can i get the logged user???
Without passing Request parameter How Can i get the Logged in Username in django