python - 在 Windows 上使用 postman 命中 centos6 上存在的 django API

标签 python django windows postman centos6

我在 centos6 机器上有我的 django 项目,我在 ssh key 的帮助下使用 putty 运行它,并且我的 Windows 上有 postman 。我想配置 django 项目,以便当我在 centos6 上运行 'python manage.py runserver` 时,Windows 上的 postman 应该能够将数据发送到 django 服务器。

假设我的 centos6 机器 IP 是 XX.XX.XX.XX 那么我应该使用 http://XX.XX.XX.XX:22 作为 postman 中的地址以发送数据或我需要在我的 django 项目 settings.py 文件中进行哪些更改。

我该怎么办?

最佳答案

尝试运行“iptables -L”。它将向您展示内核防火墙的所有规则。使用“iptables -F”刷新规则,然后以“python manage.py runserver 0.0.0.0:8000”运行服务器。

还以“http://10.12.13.130:8000/your-url ”运行 postman 。

这对我有用!

关于python - 在 Windows 上使用 postman 命中 centos6 上存在的 django API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54088294/

相关文章:

python - 如何在django View 中使用python多处理模块

windows - 为什么我在 Perl 中打开的管道中的 * 在 Windows 上不起作用?

windows - 在 Delphi 中使用 COM 支持在 DLL 和 .EXE 之间切换

python - 在 djangoviews.py 代码中使用数组 - 这是一个好习惯吗?

python - 如何在 Python 中生成可重现(带有种子)的随机 UUID

javascript - Django:在 Google map 的 javascript 中使用模板标签

php - 从 Zend Framework 开发人员的角度看 Django

windows - F# 使用 WinForms 拖放 : DragDrop event of a control does not call the referenced member function

javascript - 在 Google App Engine 中使用 JavaScript 和服务器端 Python 代码动态生成客户端 HTML 表单控件

Python 永远打开 fifo block