簡體   English   中英

Django:collectstatic 引發 OSError:[Errno 39] 目錄不為空:(ckeditor)

[英]Django: collectstatic raises OSError: [Errno 39] Directory not empty: (ckeditor)

突然間,我無法執行collectstatic

python manage.py collectstatic

Type 'yes' to continue, or 'no' to cancel: yes
Found another file with the destination path 'admin/js/jquery.init.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 189, in handle
    collected = self.collect()
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
    handler(path, prefixed_path, storage)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 344, in copy_file
    if not self.delete_file(path, prefixed_path, source_storage):
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 294, in delete_file
    self.storage.delete(prefixed_path)
  File "/home/django/maklerienv36/lib/python3.6/site-packages/django/core/files/storage.py", line 299, in delete
    os.rmdir(name)
OSError: [Errno 39] Directory not empty: '/home/django/makleri/static/ckeditor'

我試圖刪除整個靜態文件夾並重新運行collectstatic但它沒有幫助。 你知道如何讓它工作嗎?

它適用於我的 PC,這是一台服務器。

我對collectstatic也有類似的問題。 對我來說,以下幫助:

python3 manage.py collectstatic --clear

根據Django 文檔

--清除,-c

在嘗試復制或鏈接原始文件之前清除現有文件。

問題是self.delete_file(path, prefixed_path, source_storage)在非空目錄上不起作用。 -rf會有所幫助,但 django 的collectstatic.py不使用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM