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

我试图在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'

I was trying to run django app on docker container. Followed steps mentioned at https://docs.docker.com/compose/django/ But after running the command docker-compose run web django-admin.py startproject composeexample . I facing error PermissionError: [Errno 13] Permission denied: '/code/manage.py' I'm using centos 7. please help

[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'
2023-02-06 15:02

满意答案

有一个悬而未决的上游问题1842问题1936

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

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


The problem was with SELinux enabled on centos 7. It worked here.

相关问答

更多

PermissionError:[Errno 13]权限被拒绝:pipenv安装请求的'Pipfile'(PermissionError: [Errno 13] Permission denied: 'Pipfile' for pipenv install requests)

确保已将UserBase的bin目录添加到路径中(请按照您所遵循的文档中的“注释”框查看如何执行此操作)。 您提到的第三个命令应该是: pipenv install requests 。 更长的版本: 我将更深入地了解一些命令行概念,因为您已经开始使用命令行(以及其他想要更深入参考的人)。 您显示三个命令: pip3 install --user pipenv 这是完美的,在安装pipenv作为用户包(不适用于整个系统) python3 -m pipenv 这没有任何作用。 您看到的内容是“ 使用...

PermissionError:[Errno 13]权限被拒绝Python(PermissionError: [Errno 13] Permission denied Python)

尝试将端口更改为8080.您没有说明哪个操作系统,但大多数UNIX衍生产品只允许root用户监听1,024或4,096以下的端口,具体取决于操作系统及其配置。 Try changing the port to 8080. You didn't say which OS, but most UNIX derivatives will only allow root to listen on ports below 1,024 or 4,096 depending on the OS and its ...

使用GNU / Linux并使用os.makedirs()的Python3.7 - PermissionError:[Errno 13]权限被拒绝(Python3.7 with GNU/Linux and using os.makedirs() - PermissionError: [Errno 13] Permission denied)

umask指定未设置的权限。 您可能需要os.umask(0o000) 。 有关更多信息,请参见http://man7.org/linux/man-pages/man2/umask.2.html 。 umask specifies which permissions to NOT set. You probably want os.umask(0o000) instead. See http://man7.org/linux/man-pages/man2/umask.2.html for more...

Python [Errno 13]权限被拒绝:(Python [Errno 13] Permission denied:)

正如Charles Duffy在我最初的问题中评论的那样,问题实际上是用于读取和写入文件的代码行没有缩进到for循环中。 更正缩进修复了问题,现在可以根据需要使用。 一个很好的提醒,总是检查简单的事情....我已经如此包裹,为什么它不工作,我甚至没有注意到缺少缩进。 As Charles Duffy commented under my original question, the issue was in fact that the lines of code for reading and w...

向Windows主机文件添加一行:PermissionError:[Errno 13]权限被拒绝[重复](Adding a line to Windows hosts file: PermissionError: [Errno 13] Permission denied [duplicate])

您需要做的是使用提升的权限运行Python脚本。 请参阅此问题,并执行此操作。 What you need to do is run your Python script with elevated privileges. Refer to this question and this one to do so.

PermissionError Errno 13权限被拒绝(PermissionError Errno 13 Permission denied)

您正尝试打开一个文件夹进行书写: f = open(r"C:\Users\Grty\Desktop\de", "w+") 但是这是一个文件夹,即使在"r"模式下也不能用open() ,因为它不是文件,如果你尝试,Windows会说拒绝访问 。 当你获得每个filename ,打开: for filename in os.listdir(os.getcwd()): with open(filename) as f: content = f.read() You are ...

Django OSError:[Errno 13]权限被拒绝(Django OSError: [Errno 13] Permission denied)

授予文件夹/ var / www / staticfiles所需的权限: chmod -R 755 /var/www/staticfiles 如评论中所述,不建议向所有用户授予权限777 ,而是尝试使用chown -R your_user your_file更改文件夹的所有者 Give the permission necessary to the folder /var/www/staticfiles: chmod -R 755 /var/www/staticfiles As mention...

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

有一个悬而未决的上游问题1842和问题1936 。 PR 1843对于第一个将会让你到达某个地方,但这不是长期或刺激。 请监控他们,你会得到一个正确的答案 The problem was with SELinux enabled on centos 7. It worked here.

PermissionError:[Errno 13]尝试从NotePad ++运行,但不是从IDLE运行(PermissionError: [Errno 13] when trying to run from NotePad++ but not from IDLE)

正确的答案是Juxhin所说的,Notepad ++必须以管理员身份运行。 我喜欢它被张贴为答案! The correct answer is what Juxhin said, Notepad++ must be run as administrator. I liked it was posted as an answer!!!

pip install - PermissionError:[Errno 13]权限被拒绝(pip install - PermissionError: [Errno 13] Permission denied)

你有没有像numpy和scipy一样安装它的依赖项 ? 检查出来,然后我们会继续下去。 最终解决方案:尝试conda如conda install scikit-learn=_version_ Have you installed its dependencies like numpy and scipy? Check it out and then we will proceed further. Final Solution: try conda like conda install sciki...

相关文章

更多

JAVA设计模式学习13——代理模式

代理(proxy)模式:指目标对象给定代理对象,并由代理对象代替真实对象控制客户端对真实对象的访问。 ...

微信公共服务平台开发(.Net 的实现)13-------网页授权(下 :C#代码的实现 )

接着上次的理论,我们这次来研究用代码实现“网页授权获取用户基本信息”,首先我们需要一个链接指向微信的授 ...

我的架构演化笔记 13:自己动手写Nutch-index插件导入数据到MongoDB

需求是导入数据到MongoDB. 1创建目录 在$Nutch_home/src/plugin ...

微信公共服务平台开发(.Net 的实现)13-------网页授权(下 :C#代码的实现 )

接着上次的理论,我们这次来研究用代码实现“网页授权获取用户基本信息”,首先我们需要一个链接指向微信的授 ...

C#开发微信门户及应用(13)-使用地理位置扩展相关应用

本文继续上一篇《C#开发微信门户及应用(12)-使用语音处理》,继续介绍微信的相关应用。我们知道,地理 ...

一周好文(13)

1.自然而流畅——聊聊界面的切换动画 观察细致入微 2.程序员学英语 3.产品的思路——来自腾讯张小龙 ...

实习笔记 13:总结

看了denny的总结,感触很多。 其实没必要太看重产品,很多东西淘宝微信discuz,qq群就能实现了 ...

13年7月memory point

IOS/android美术资源压缩相关工具使用,shell编写; 美术资源地图压缩方案; IAP支付o ...

微信支付 发布后显示 System:access_denied

微信支付发布后显示 System:access_denied (android)或System:not ...

最新问答

更多

Python / IPython奇怪的不可重现列表索引超出范围错误(Python/IPython strange non reproducible list index out of range error)

你得到IndexError的原因是你的输入文件显然不是完全用制表符分隔的。 这就是为什么当您尝试访问它时, splits[1]没有任何内容。 您的代码可以使用一些重构。 首先,你正在重复使用if -checks,这是不必要的。 这只是将cds0到7个字符,这可能不是你想要的。 我将以下内容放在一起,以演示如何重构您的代码,使其变得更加pythonic和干燥。 我无法保证它能够与您的数据集一起使用,但我希望它可以帮助您了解如何以不同的方式执行操作。 to_sort = [] # W

故事板从表格单元中延伸出来并显示其详细信息披露按钮(storyboard segue from a tablecell an its Detail Disclosure Button)

我不认为你可以链接一个特定的细节披露按钮瓦特/赛格。 我的故事板是非常程序化的B / C我使用了很多定制CGRect等。 所以我倾向于使用这样的东西: -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"ViewControllerIdentifer"

我们可以将Gherkin功能文件与testcomplete集成(Can we integrate Gherkin feature files with testcomplete)

TestComplete不支持Gherkin功能文件。 但是,TestComplete具有SDK,因此可以自己为此创建扩展。 TestComplete does not support Gherkin feature files. However, TestComplete has SDK so it is possible to create an extension for this by yourself.

TrustAllCertificatesCallback被忽略(TrustAllCertificatesCallback is ignored)

我没有做过这样的事情,但看看我认为可以看出错误的例子。 试试这个代码: static class Program { static void Main() { var tcpclient = new TcpClient("remote.example.com", 443); var tcpstream = tcpclient.GetStream(); var sslstream = new SslStream(tcpstream,

返回嵌套元素的索引(Return index of nested element)

您需要获取父li元素的索引。 否则,您将获得列表项内锚点的索引,该索引始终为零。 $(this.parentNode).index(); You need to get the index of the parent li element. Otherwise you are getting the index of the anchor inside the list item, which will always be zero. $(this.parentNode).index();

在数组中重新编号元素的有效方法(Efficient way of re-numbering elements in an array)

您需要多次迭代列表,我认为没有办法解决这个问题。 毕竟,在开始更改元素(第二遍)之前,首先必须确定不同元素的数量(第一遍)。 但是请注意,由于对index的重复调用而not in列表中具有O(n),因此可能具有最多O(n ^ 2)的不同元素的数量。 或者,您可以使用dict而不是value_map的list 。 字典比列表具有更快的查找速度,因此,复杂性应该确实在O(n)的数量级上。 您可以使用(1)字典理解来确定旧值到新值的映射,以及(2)用于创建更新子项的列表理解。 value_map =

Express app定义的`static`文件夹无法正常工作(Express app defined `static` folder not working properly)

选项1 你可以改变这一行: app.use( express.static(__dirname + '/puplic')); //my public folder. 至 app.use('/oneTime', express.static(__dirname + '/puplic')); //my public folder 选项2 我假设你在公共文件夹中有一个js文件夹,然后你需要更改你的HTML代码:

使用node.js和socket.io每秒广播一次(Using node.js and socket.io to broadcast every second)

对于计时器值,请在服务器端本身每秒更新本地计时器。 每当有任何用户进来时,给他这个值以及计时器的总值。 然后客户端将根据dandavis评论在本地启动自己的计时器,但在服务器端保留一些间隔,如15或10秒,服务器将广播当前计时器值,以便客户端相应地进行同步。 简而言之,服务器将每隔10(n:你决定)秒后广播,但它将在本地每秒更新定时器变量。 每当客户端进入时,它将获得总计时器值和当前计时器值。 广播当前出价的休息功能可以以正常方式完成。 For timer value, keep updatin

如何让XMLSerializer将命名空间添加到嵌套对象中的属性?(How do I get the XMLSerializer to add namespaces to attributes in nested objects?)

IXmlSerializable也许? 注意我还添加了(对A ): [XmlElement("A", Namespace = "http://www.example.com/namespace")] public TestSoapHeaderTypeValuePair A {...} 代码如下: public class TestSoapHeaderTypeValuePair : IXmlSerializable { private string _type; private