how to let django return response to web browser at my own function
19 views
Skip to first unread message
肖子聪
unread,
Feb 6, 2019, 6:54:46 AM2/6/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
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 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 end of functions in views.py .
Matthew Pava
unread,
Feb 6, 2019, 9:02:06 AM2/6/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message