Forums

Deploying Django + CouchDB

I found this way to deploying my app made with Django. I´ve followed step by step, and I think i´m one step to the end. In localhost, the development, runs perfectly. But here, at my web, i found this error:

[Errno 111] Connection refused

Request Method: GET Request URL: http://javiramone.pythonanywhere.com/ Django Version: 1.3.7 Exception Type: error Exception Value:

[Errno 111] Connection refused

Exception Location: /usr/lib/python2.7/socket.py in create_connection, line 571 Python Executable: /usr/local/bin/uwsgi

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

And the last Traces looks like:

/home/javiramone/.local/lib/python2.7/site-packages/couchdb/http.py in get

            if scheme == 'http':

                cls = HTTPConnection

            elif scheme == 'https':

                cls = HTTPSConnection

            else:

                raise ValueError('%s is not a supported scheme' % scheme)

            conn = cls(host, timeout=self.timeout)

            conn.connect()

...

        return conn

    def release(self, url, conn):

        scheme, host = urlsplit(url, 'http', False)[:2]

        self.lock.acquire()

▶ Local vars /usr/lib/python2.7/httplib.py in connect

            if line == '\r\n':

                break

    def connect(self):

        """Connect to the host and port specified in __init__."""

        self.sock = socket.create_connection((self.host,self.port),

                                             self.timeout, self.source_address)

...

        if self._tunnel_host:

            self._tunnel()

    def close(self):

        """Close the connection to the HTTP server."""

▶ Local vars /usr/lib/python2.7/socket.py in create_connection

        except error as _:

            err = _

            if sock is not None:

                sock.close()

    if err is not None:

        raise err

...

    else:

        raise error("getaddrinfo returns an empty list")

I´ve installed CouchDB without any problem (my DB is hosted on iriscouch) and the app get into it with this

from couchdb import Server

from couchdb import ResourceNotFound

SERVER = Server('http://admin:empresadigitala@programs.iriscouch.com/'

It may be that with my free account, i can´t connect with iriscouch?

Thanks for your helping

It looks like the python couchdb package does not respect the proxy settings from the environment and does not support setting a proxy. See this StackOverflow question and this bug report that is referenced in it. Until you can configure python-couchdb to use a proxy, it will not work for free accounts.

What should I do? I don´t find any useful answer. Maybe, should I become a premium member in pythonanywhere?

It will definitely work if you sign up for a paid account (though you'll need to reload your web app after upgrading).

what account should i choose? Hacker? web dev?... Thank you a lot for the help

Hacker will be fine if you want to keep using the javiramone.pythonanywhere.com domain. The main difference with Web Developer is that you would be able to use your own domain, if you already have one...

I´d preffer the cheapest jajajaja, so, with hacker account could I connect with irishcouch? thanks

Yep, should be fine...