gpt4 book ai didi

django - 在pythonanywhere上托管一个使用redis的Django项目

转载 作者:IT王子 更新时间:2023-10-29 06:09:46 24 4
gpt4 key购买 nike

我在本地笔记本电脑上开发了一个电子商务网站,该项目使用 redis,当我从本地主机运行该项目时,它使用以下命令完美运行r = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB):

REDIS_HOST = 'localhost'
REDIS_PORT = 6379
REDIS_DB = 1

现在,我正在尝试将项目部署到任何地方的 python。我已经安装了 redis 并启动了服务器,将 localhost 更改为 myhost.pythonanywhere.com 但是当我运行访问该站点时出现以下错误:

Error 111 connecting to 50.19.109.98:6379. Connection refused.
Request Method: GET
Request URL: http://myhost.pythonanywhere.com/en/4/black-garbage-t-shirt/
Django Version: 1.8.3
Exception Type: ConnectionError
Exception Value:
Error 111 connecting to 50.19.109.98:6379. Connection refused.
Exception Location: /home/dguy/dguy/venv/lib/python3.4/site-packages/redis/connection.py in connect, line 436
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.4.3
Python Path:
['/var/www',
'.',
'',
'/var/www',
'/home/dguy/dguy/venv/lib/python3.4',
'/home/dguy/dguy/venv/lib/python3.4/plat-x86_64-linux-gnu',
'/home/dguy/dguy/venv/lib/python3.4/lib-dynload',
'/usr/lib/python3.4',
'/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/home/dguy/dguy/venv/lib/python3.4/site-packages',
'/home/dguy/dguy',
'/home/dguy']
Server time: Wed, 17 Aug 2016 16:10:56 +0100

谁能帮帮我。什么是正确的配置。

最佳答案

Redis 不适用于 PythonAnywhere。

关于django - 在pythonanywhere上托管一个使用redis的Django项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39000847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com