肖子聪
unread,Feb 6, 2019, 6:54:46 AM2/6/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I'm trying to write a function to check whether user logged or not. If logged, return user's name,if not, redirect to the login page. I want to write it as a shortcut function like "get_object_or_404". My question is, how to let django return an response to web browser at anywhere I like, not just at the end of a function in views.py.