如何在Django中实现Https(SSL中间件) [英] How to implement Https(SSL Middleware) in Django

查看:78
本文介绍了如何在Django中实现Https(SSL中间件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Django和网络开发的新手.我想实施正是这个问题,但在django.我搜索了许多博客和问题,但没有地方可以找到确切的实现方法.我无法很好地理解 SSL中间件Django .如果是这样的解决方案,谁能告诉我如何实现?

I am a newbie in Django and web development. I want to implement Exactly this Question, but in django. I have searched many blogs and questions, nowhere was i able to find,exactly how to implement this. The SSL Middleware Django, is something i couldnt grasp very well. If that is the solution, can anyone please tell me how to implement it?

问题是否清楚?还是我需要添加一些内容,请评论我将进行必要的更改.我们将非常感谢您的帮助.

Is the question clear ? or do i need to add a few things, please comment i will make the necessary changes.Any help will be highly appreciated.Thanks in advance.

P.S:我已在服务器上添加了ssl证书.这样就可以了.

P.S: I have added the ssl certificate on the server. So that is taken care of.

推荐答案

您只需要将中间件类添加到settings.py中的中间件列表中,并按照代码片段中的说明进行操作即可.此处是中间件的文档指南.

You just need to add the middleware class to the list of middleware in your settings.py and follow the instructions for your views as directed in the snippet. Here's the documentation guide to middleware.

希望对您有帮助.

这篇关于如何在Django中实现Https(SSL中间件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆