【发布时间】:2020-10-08 22:30:04
【问题描述】:
我有一个 Django 项目,我仅使用 Django 提供的 WSGI 服务器部署了该项目(没有像 apache、ngnix 等网络服务器)。 问题是我想为网站的 HTTPS 版本上传 SSL 证书。请问我该怎么做? 提前感谢您的回答。
【问题讨论】:
标签: django ssl django-wsgi
我有一个 Django 项目,我仅使用 Django 提供的 WSGI 服务器部署了该项目(没有像 apache、ngnix 等网络服务器)。 问题是我想为网站的 HTTPS 版本上传 SSL 证书。请问我该怎么做? 提前感谢您的回答。
【问题讨论】:
标签: django ssl django-wsgi
您可以将Let’s Encrypt 和Certbot 用于您网站的HTTPS 版本。
我建议您使用 Nginx 或 Apache 等 Web 服务器进行练习。此外,您的应用程序运行得更好。
您可以从medium 阅读此简单指南。
如果您使用的是 Ubuntu 或其他 Linux 发行版:
# adding certbot repository
sudo add-apt-repository ppa:certbot/certbot
# do not forget to update your dependencies after adding some repo
sudo apt update
# installing certbot
sudo apt-get install python-certbot-nginx
# pointing certbot to your domain
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
【讨论】: