根据以下内容总结了下:

http://www.voidcn.com/article/p-xxdfvetx-da.html

http://www.voidcn.com/article/p-ezmbnnye-da.html

http://blog.sina.com.cn/s/blog_87a692aa0101owex.html

创建自签名ssl证书

1、下载软件openssl-0.9.8k_WIN32

2、解压后进入bin目录,双击打开openssl.exe,依次运行如下命令


genrsa -des3 -out server.key 2048
req -new -key server.key -out server.csr -config openssl.cnf
rsa -in server.key -out server_no_passwd.key
x509 -req -days 365 -in server.csr -signkey server_no_passwd.key -out server.crt

例:

至此生成了证书文件

3、复制到django项目下

python库下载

pip3 install django-extensions
pip3 install django-werkzeug-debugger-runserver
pip3 install pyOpenSSL

配置django的setting.py

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
'werkzeug_debugger_runserver',
'django_extensions',
]

启动server

python manage.py runserver_plus --cert server.crt 0.0.0.0:8088

访问URL

打开URL:https://localhost:8088/,开始提示证书风险,啥也没干,过了一会儿又显示经过验证了。。。。这个不懂

django使用https的更多相关文章

  1. Django配置https协议

    本博客来自https://blog.csdn.net/huplion/article/details/52892901 1.首先我们需要得到一张证书文件 参考:WINDOWS系统下创建自签名SSL证书 ...

  2. nginx+django+uwsgi+https 配置问题点

    - ssl 证书申请 申请域名的网站申请下载对应文件即可 - nginx  配置 https [root@VM_2_29_centos conf]# nginx -t nginx: [emerg] u ...

  3. Django开启https(不用nginx)

    首先安装需要用到的包 pip install django-extensions pip install django-werkzeug-debugger-runserver pip install ...

  4. django配置https

    1. pip install django-extensions pip install django-werkzeug-debugger-runserver pip install pyOpenSS ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. CentOS+Apache+mod_wsgi+Python+Django

    前言 网上有关的教程千篇一律,都是无脑抄,自己都不验证一遍就直接复制,毫无意义,我通过官方文档和自己摸索,总结了一套教程. Django自带Web服务功能,但那只是方便开发调试,生产环境中一般将Dja ...

  7. python Web开发框架-Django (2)

    接上篇文章,介绍一些实用的技巧和注意点.首次用MarkDown编辑,感觉行空隙太大,不是那么好看. GET/POST 前后端会有数据交互,使用JQuery来实现get/post请求 GET 方法1:通 ...

  8. 使用Django——安装

    1. 安装 a) 安装python 在http://www.python.org/上下载python 2.7,然后安装,接着将python的安装路径(一般是C:\python27)添加到windows ...

  9. 安装django

    我已经有Python3.5的环境了.我们去下载Django.https://github.com/django/django.git  直接下载为zip解压即可. 然后在命令提示符下安装 1.  切换 ...

随机推荐

  1. 解决node.js链接数据库时出现的报错 --- client does not support authentication

    打开mysql数据库小黑屏 然后输入 mysql> alter user 'root'@'localhost' identified with mysql_native_password by ...

  2. Euclid`s Game

    题目 给定两个整数 a 和 b,Stan和Ollie轮流从较大的数字中减去较小的数的倍数.这里的倍数是指1倍.2倍这样的整数倍,并且相减后的结果不能小于0.Stan先手,在自己的回合将其中一个数变成零 ...

  3. LeetCode 1249. Minimum Remove to Make Valid Parentheses

    原题链接在这里:https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/ 题目: Given a string s ...

  4. js json 排序

    /* json:需要排序的json key:排序项 */ function JsonSort(json, key) { //console.log(json); for (var j = 1, jl ...

  5. 洛谷 p1968 美元汇率 题解

    传送门 美元由马克转化,马克由美元转化 求最大美元 每一天只有2种选择 ①:不转化另一货币 ②:转化另一货币 典型01背包 可以开一个二维数组f[100][3] F[i][1]表示前i天获得最大美元 ...

  6. 【luoguP1858】多人背包

    链接 对于每个状态\(f[j]\)多记录一个维度,转移的时候利用类似于归并排序的方法合并,以保证时间复杂度可以承受 注意事项:前\(K\)大可以有重复的价值 #include<iostream& ...

  7. 06-图2 Saving James Bond - Easy Version (25 分)

    This time let us consider the situation in the movie "Live and Let Die" in which James Bon ...

  8. wireshark安装和使用 -基础篇

    使用前知道: wireshark版本:3.0.2 使用wireshark的目的是因为它支持linux/windows/mac,而且新版本是开源免费的.还有一个原因是使用Fiddler不支持mac.截止 ...

  9. R语言中的管道操作符 %>% %T>% %$% %<>%

    magrittr 包的官网 https://magrittr.tidyverse.org/ magrittr 包的 github 主页 https://github.com/tidyverse/mag ...

  10. docker-nginx 与 tomcat--dockerfile

    nginx: FROM nginx:latest COPY nginx/sources.list /etc/apt/sources.list #RUN apt-get update && ...