简体   繁体   English

Django,django oscar和Digital Ocean

[英]Django, django oscar & Digital Ocean

  1. I am using Digital Ocean servers to hosts my site. 我正在使用Digital Ocean服务器托管我的站点。 When I run the site with debug = True, it runs fine but when I set it to False, it gives internal server error. 当我使用debug = True运行站点时,它运行良好,但是当我将其设置为False时,它将出现内部服务器错误。 I have put my domain name and IP in list of allowed hosts. 我已将域名和IP放入允许的主机列表中。 Any suggestions? 有什么建议么?

  2. Also, I have collected the static files for django admin and django oscar using manage.py collectstatic in static folder and they are being served properly. 另外,我已经在static文件夹中使用manage.py collectstatic了django admin和django oscar的static文件,并且可以正常使用它们。 But, I have put some other files too in the same folder which include favicon, logo images etc and few css files. 但是,我也将一些其他文件放在了同一文件夹中,其中包括favicon,徽标图像等,以及一些CSS文件。 The css files are being served properly but the logo and favicon gives a 403(forbidden) error. css文件已正确提供,但徽标和网站图标显示403(禁止)错误。 Again, suggestions? 再次,建议?

If you are using Apache and mod_wsgi, then your /static/ folder and/or some images in it probably do not grant permission to the Apache user to serve them. 如果您使用的是Apache和mod_wsgi,则/ static /文件夹和/或其中的某些映像可能不会向Apache用户授予服务它们的权限。

Try this: 尝试这个:

chown -R www-data /path/to/folder/static

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

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