Forums

Redis and open ports

Hello, I would like to use redis in my application, but it seems that the port used by default 6379 is closed. Could you please specify the open ports for the fee-paying users?

2014-01-29 13:40:19,526 :Error:Got exception during processing: Error 111 connecting localhost:6379. Connection refused., traceback:Traceback (most recent call last):

Thanks

Are you trying to run a redis server on PythonAnywhere? Unfortunately we don't support that right now.

Yep, ok thanks.

If redis is not supported, is there another way I can persist a state in my application? I want to develop a chat-similar feature with the messages streamed to the user. Thanks

You could use MySQL -- would that work?

What about now?

No, not yet.

Is there a way to be able to connect to remote redis?

For example, now when I do something like this:

redis_db = redis.Redis(
    host='redis-13872.c99.us-east-1-2.ec2.cloud.redislabs.com:13872',
    port=13872, 
    password='asgdhjasgdhjasgdgsa')

redis_db.get(‘my_value’)

I get:

"Error 111 connecting to redis-13872.c99.us-east-1-2.ec2.cloud.redislabs.com:13872. Connection refused."

What would you recommend to do?

Not if you are a free user. (you will have to upgrade)

Thanks for the prompt reply!

can i use redis now as a free user?

No, we have not changed that.

I'm using redis for my celery backend. I could run the redis server without any problem but when i try to run the celery worker i get this error:

consumer: Cannot connect to redis://synthlab.pythonanywhere.com:6379//: Error 111 connect ing to synthlab.pythonanywhere.com:6379. Connection refused..

is it because I'm a free user?

Yes, it is. Free users can only connect out using http(s) to the sites on our whitelist.

Can you use redis server if you own the 'Hacker' paid programm?

Yes, if you have a redis server to connect to.

The redis server where I have to connect, will be initalized in the bash console I guess. I want to use Django Channels, in order to do that, I need to use some ChannelLayers, as a backend channel layer, I need to use the redis-server. Is this possible here?

I don't believe it is. First: As I understand Django Channels, they rely on websockets and websockets do not work on PythonAnywhere. Also, a redis server running in a console or a task is not visible to anything else.

Any update on this yet? I need to run redis-server with my app. Is this possible on PA yet?

Not yet. You can run redislite but not with channels.

Any update on this yet? i need redis as a cache

No updates, sorry.

my redis server is not on pythonanywhere but why am i getting: redis.exceptions.ConnectionError: Error 111 connecting to ouyyttrsaa-angced-39499.upstash.io:4579. Connection refused.

Free accounts cannot make outbound network connections apart from HTTP or HTTPS requests to sites on our allowlist. You'd need a paid account in order to use an external Redis service.

Hi, i have a paid account, but when i try to connect to external redis broker i receive the following error:

[2024-11-07 13:28:30,010: ERROR/MainProcess] consumer: Cannot connect to rediss://red-csmbtb23esus73dubbag:**@oregon-redis.render.com:6379//: Error 111 connecting to oregon-redis.render.com:6379. Connection refu sed..

I believe we've already replied to your query via email, @buildingbills. For others with same issues -- when you upgrade the account, and run your code in a console, you need to create a fresh console, as the old one would still have the free account's restrictions.