根据以下内容总结了下:

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. 【每天学一点linux】后台进程不打印日志

    command > out.file 2>&1 & 将文件输出到指定的文件中

  2. es6 -- rest 参数

    es6 引入了rest参数(形式:...变量名),用于获取函数的多余参数,这样就不需要使用arguments对象了.rest参数搭配的变量是一个数组,该变量将多余的参数放入数组中. function ...

  3. SQL注入学习

    本次实验环境用的是Xampp,搭建的sqli-labs 配置环境: 下载路径https://github.com/Audi-1/sqli-labs,下载源代码,将解压好的文件夹放在xampp\htdo ...

  4. yugabyte 做为hasura graphql-engine的pg数据引擎

    今天看了下yugabyte 的更新 ,ysql 基本可以生产可用,刚好测试了下与hasura graphql-engine的集成,发现很不错,可以直接运行 环境准备 docker-compose ve ...

  5. haproxy 2.0 dataplaneapi docker 镜像

    为了方便测试dataplaneapi 基于官方的docker镜像,制作了一个简单的包含dataplaneapi 的镜像 下载dataplaneapi https://github.com/haprox ...

  6. 洛谷P2607题解

    想要深入学习树形DP,请点击我的博客. 本题的DP模型同 P1352 没有上司的舞会.本题的难点在于如何把基环树DP转化为普通的树上DP. 考虑断边和换根.先找到其中的一个环,在上面随意取两个点, 断 ...

  7. xms西软预定列表-房类市场

    select b.descript,sum(a.quan) as quan,case WHEN c.descript is null THEN '团队预留' ELSE c.descript end a ...

  8. linux netstat 命令简介

    常用选项: -r, --route 显示路由表 -i, --interfaces 显示接口信息表-s, --statistics 显示网络协议汇总信息 -n, --numeric 不解析域名-p, - ...

  9. 2019蓝桥杯Java第十题大学生B组——最短路径思想

    题目: 代码: package priv.tzk.lanqiao.ten; import java.io.IOException; import java.util.Scanner; public c ...

  10. 使用kubectl访问kubernetes集群

    之前访问k8s都是通过token进去dashboard,如下所示.但是现在希望通过kubectl访问k8s,所以还需要进一步的配置. 1. 安装kubectl命令行工具,配置环境变量,环境变量的值指向 ...