Collectstatic权限被拒绝,pythonanwhere bash termin

2024-10-01 17:23:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在pythonanwhere的bash终端中使用collectstatic命令:

python manage.py collectstatic

但我得到:

PermissionError: [Errno 13] Permission denied: '/static'

有人能帮忙吗?我已经试着修好这两天了。在

以下是完整的错误:

nomadpad-virtualenv) 11:51 ~/nomadpad (master)$ python manage.py collectstatic Copying '/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/djang o/contrib/admin/static/admin/img/inline-delete.svg' Traceback (most recent call last): File "manage.py", line 22, in execute_from_command_line(sys.argv) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/management/init.py", line 364, in execute_from_command_line utility.execute() File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/management/init.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/management/base.py", line 283, in run_from_argv self.execute(*args, cmd_options) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/management/base.py", line 330, in execute output = self.handle(*args, options) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /contrib/staticfiles/management/commands/collectstatic.py", line 199, in handle collected = self.collect() File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect handler(path, prefixed_path, storage) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /contrib/staticfiles/management/commands/collectstatic.py", line 364, in copy_file self.storage.save(prefixed_path, source_file) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/files/storage.py", line 54, in save return self._save(name, content) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/site-packages/django /core/files/storage.py", line 321, in _save os.makedirs(directory) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/home/DMells123/.virtualenvs/nomadpad-virtualenv/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/static'

静态设置

^{pr2}$

Tags: djangoinpyselfhomevirtualenvlibpackages

热门问题