Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django Deployment Problem
#1
In on of my Django view´s I am making a request to another webserver via requests, this code works perfect when I run the it with the development server. It looks like that:

import requests
r = requests.post('http://www.example.org')
return r.text
But when I Deploy this with the apaches server it throws this error:

Error:
ConnectionError HTTPConnectionPool(host='www.example.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23e917ba58>:Failed to establish a new connection:[Errno -2] Name or Service not known'))
But I can run the code as root user on the Deployment server without a problem this is why i think it is a permission problem. But i have no Idea how to solve this.
Thanks in advance!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Flask, Self-hosted deployment, which server ? SpongeB0B 1 3,021 Apr-11-2021, 11:29 AM
Last Post: snippsat
  Flask deployment from heck lmolter54 4 2,522 Jun-04-2020, 09:08 PM
Last Post: lmolter54
  Django deployment on apache server? tmmaersk 2 2,106 Mar-28-2020, 03:35 PM
Last Post: tmmaersk
  Django problem with files menator01 1 1,943 Jan-05-2020, 04:20 PM
Last Post: menator01
  Django admin login problem erfanakbari1 0 2,050 Dec-29-2019, 12:29 PM
Last Post: erfanakbari1
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,303 Jun-30-2019, 12:21 AM
Last Post: scidam
  Django startapp problem nengkya 4 8,041 Jul-01-2017, 08:37 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020