代码之家  ›  专栏  ›  技术社区  ›  garg10may

直接向gunicorn发送请求

  •  1
  • garg10may  · 技术社区  · 8 年前

    haproxy --> nginx --> gunicorn --> django . 我需要从服务器本身向django发送一些请求,但由于某些网络限制,无法使用http url,即haproxy或nginx one。

    gunicorn 直接使用python。喜欢下面的网址 nginx 使用 http://unix:/code/tanmay.garg/web/utrade/run/gunicorn.sock

    2 回复  |  直到 8 年前
        1
  •  0
  •   user554538 user554538    8 年前

    NetCat 通过给它一条通往gunicorn插座的路径:

    nc -U /code/tanmay.garg/web/utrade/run/gunicorn.sock
    
        2
  •  0
  •   Arghya Saha    8 年前

    为什么不尝试使用django信号来触发要执行的任务,而不需要使用外部api调用或任何其他调用。

    你可以从 here 或 this tutorial