Django-NameError: name ‘request’ is not defined, in Django functions

QuestionsCategory: DjangoDjango-NameError: name ‘request’ is not defined, in Django functions
devchandan Staff asked 3 months ago

NameError: name ‘request’ is not defined, in Django functions

I have written a Function in Django to read sessions variable.

 

# Function to Check Login
def check_login:
	# print the session variable
	print(request.session['user'])