RE: how to let django return response to web browser at my own function

2019-02-06 Thread Matthew Pava
You probably just want to use the login_required decorator. https://docs.djangoproject.com/en/2.1/topics/auth/default/#the-login-required-decorator -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of ??? Sent: Wednesday, February 6,

how to let django return response to web browser at my own function

2019-02-06 Thread 肖子聪
I want to write a function 'get_user_or_log_in' to check whether the user has logged or not. If logged, return user's name, if not, redirect to the login page. I want to use it like function 'get_object_or_404'. But I do not know how to let django response at my own function not just at the