python - 默认的 django 开发服务器是安全的还是其他人可以访问它?
问题描述
我是 django/python 的新手,想确保如果我从我的工作机器上自己学习 django,当 django 设置其自动开发服务器时,它不会是某种安全漏洞。我正在使用本教程:https ://docs.djangoproject.com/en/2.1/intro/tutorial01/
他们让您将开发服务器设置为:
$ python manage.py runserver
输出:
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
November 17, 2018 - 15:50:53
Django version 2.1, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
其他人是否可以通过网络或仅通过 Internet 访问此服务器?怎么去检查呢?
解决方案
将开发服务器托管在localhost
(相当于127.0.0.1
)上不会使您面临系统中可能已经存在的任何风险。您必须非常刻意地努力使外部连接可以访问它。
如果您希望在本地网络上访问该站点,您可以在0.0.0.0
. 最重要的是,您必须要么已经以某种方式受到损害,要么已经做出了刻意的努力,才能通过运行开发服务器而暴露更多信息。只是在投入生产时不要使用它。
推荐阅读
- c# - 如何在 Designer.cs 文件中创建控件实例?
- angular - 如何将 Nativescript App 应用程序转换为 Web 应用程序?
- angular - 遍历模板中的 ng-content
- python - 用python解析文件
- arrays - 将嵌套属性推送到 Angular 中的 JSON 数组中
- google-maps - 如何将项目和 API KEY 从开发人员仪表板移动到客户新帐户
- python - FFT 的最佳方法 - 最大。值 FFT - Python
- javascript - 通过 javascript 获取当前 URL 地址
- ios - Swift:UIView 中的 applicationDidBecomeActive?
- json - 什么决定(如何配置)php PDO 驱动程序对日期和时间戳字段的值使用什么格式字符串?