Python Forum

Full Version: Django Deployment Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!