有人能帮我解决这个错误吗?我不知道密码有什么问题。是数据库凭据错误吗?这是应用程序代码错误吗?这是与Linux/Unix相关的错误吗?
这是我第一次在Heroku上部署我的应用程序,但我收到了以下错误消息:
PermissionError: Errno 13权限被拒绝:'/etc/passwd-‘
python ph_dorms/manage.py collectstatic --noinput
Traceback (most recent call last):
File "ph_dorms/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
collected = self.collect()
File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 353, in copy_file
with source_storage.open(path) as source_file:
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", line 33, in open
return self._open(name, mode)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", line 218, in _open
return File(open(self.path(name), mode))
PermissionError: [Errno 13] Permission denied: '/etc/passwd-'
! Error while running '$ python ph_dorms/manage.py collectstatic --noinput'.
See traceback above for details.
You may need to update application code to resolve this error.
Or, you can disable collectstatic for this application:
$ heroku config:set DISABLE_COLLECTSTATIC=1
https://devcenter.heroku.com/articles/django-assets
! Push rejected, failed to compile Python app.
! Push failed发布于 2018-03-10 12:17:35
部署django The应用程序的复杂部分在大多数情况下都与收藏相关,只有当您没有正确设置所有内容以服务同一台服务器上的静态文件时。
首先,在终端或cmd中禁用运行以下内容的收藏库:
heroku config:set DISABLE_COLLECTSTATIC=1那就重新部署。
发布于 2018-03-10 13:54:42
您应该禁用heroku上的收藏库,并使用whitenoise在生产中提供静态文件。
在cmd中运行(安装了heroku cli )
heroku config:set DISABLE_COLLECTSTATIC = 1或者将值等于1的DISABLE_COLLECTSTATIC添加到heroku中的环境变量中。
然后,使用白雪公主在生产中提供静态文件。
https://stackoverflow.com/questions/49207415
复制相似问题