Django nginx webserver no accepts api post Cron Job

Viewed 41

there is web gui running and the function the function add_analyzer_recods() is executed by a cron job because its testing some ip stuff.

In development all works fine, the script is executed and the webpages templates are displaying data.

In production I have a nginx server and the templates are displaying propers but as soon the crone job executes a test script, the script fails:

HTTPConnectionPool(host='127.0.0.1', port=8000):

do: python manange.py runserver fixes the problem but that is not a permanent solution; any idea how nginx can handle post request calls?

def add_analyzer_recods(self, response, job, _uuid_session):
    api = "api"

    response = requests.post("http://127.0.0.1:8000/" + api,
                             json=self.ser(response, job, _uuid_session),
                             headers=self.build_headers())

urls.py

urlpatterns = [
   path(r'^api$', ApiCallView.as_view()),
]
0 Answers
Related