middleware.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:docker-grader 作者: elsys 项目源码 文件源码
def process_request(self, request):
        if request.method == 'POST' and \
           request.POST.get('lti_message_type') == 'basic-lti-launch-request':
            logger.debug('received a basic-lti-launch-request - '
                         'authenticating the user')

            # authenticate and log the user in
            user = auth.authenticate(request=request)

            if user is not None:
                # User is valid.
                # Set request.user and
                # persist user in the session by logging the user in.

                logger.debug('user was successfully authenticated; '
                             'now log them in')
                request.user = user
                auth.login(request, user)
                return HttpResponseRedirect(request.get_full_path())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号