简体   繁体   English

django heroku服务器错误

[英]django heroku server error

i have a django project which was uploaded to heroku. 我有一个django项目已上传到heroku。 In my django project I used redis also to store some data. 在我的django项目中,我还使用Redis来存储一些数据。 the application works on heroku but It happens that when ever I click a link, I get the error Server Error (500) I do not know the cause of the error but here is my redis setting that I use on local and development server. 该应用程序可在heroku上运行,但是碰巧当我单击链接时,我收到错误Server Error (500)我不知道错误的原因,但这是我在本地和开发服务器上使用的redis设置。

#REDIS FOR VIEWS REDIS_HOST = 'localhost' REDIS_PORT = 6379 REDIS_DB = 3

further codes would be provided on request 可根据要求提供更多代码

Well, Redis isn't going to be running on localhost on Heroku. 好吧,Redis不会在Heroku的localhost上运行。

You don't say how you have set up Redis, but presumably you are using one of the add-ons available through Heroku. 您没有说明如何设置Redis,但大概是您正在使用Heroku提供的附加组件之一。 These usually expose their configuration through an environment variable, which you would then use in your settings.py exactly as you do for the database settings. 这些通常通过环境变量公开它们的配置,然后将其与在数据库设置中完全一样地在settings.py中使用。 The add-on documentation itself will tell you what variable to use. 附加文档本身会告诉您要使用什么变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM