PermissionError:[Errno 13]权限被拒绝:'/ code/manage.py'

时间:2015-09-16 10:40:27

标签: python django docker docker-compose

我试图在docker容器上运行django app。 https://docs.docker.com/compose/django/中提到的后续步骤 但是在运行命令docker-compose run web django-admin.py startproject composeexample .之后 我面临错误PermissionError:[Errno 13]权限被拒绝:'/ code/manage.py' 我正在使用centos 7.请帮助

[root@localhost docker-django]# docker-compose run web django-admin.py startproject composeexample .
Traceback (most recent call last):
  File "/usr/local/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/commands/startproject.py", line 33, in handle
    super(Command, self).handle('project', project_name, target, **options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/templates.py", line 154, in handle
    with open(new_path, 'wb') as new_file:
PermissionError: [Errno 13] Permission denied: '/code/manage.py'

2 个答案:

答案 0 :(得分:0)

有一个待处理的上游问题issue 1842issue 1936

PR 1843对于第一个会让你到达某个地方但是长期或刺激不好。

请监控他们,你会得到正确答案

答案 1 :(得分:0)

问题在于在centos 7上启用了SELinux。它有效here