【发布时间】:2023-02-23 04:18:25
【问题描述】:
这个警告的原因是什么?我在 docker-compose up 命令期间得到它们。
Found another file with the destination path 'admin/js/vendor/jquery/LICENSE.txt'. 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.
Found another file with the destination path 'admin/img/LICENSE'. 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.
我在 settings.py 中的 INSTALLED_APPS 看起来像:
INSTALLED_APPS = [
"adminlte3",
"adminlte3_theme",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"corsheaders",
"django_extensions",
"drf_standardized_errors",
"user",
"celery",
]
静态:
PROJECT_ROOT = os.getcwd()
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
所以,如果我运行python manage.py findstatic
我发现很多双路径文件。
例如,
C:\Users\irina\app-backend\django_env\Lib\site-packages\adminlte3_theme\static\admin\js\core.js
C:\Users\irina\app-backend\django_env\Lib\site-packages\django\contrib\admin\static\admin\js\core.js
【问题讨论】:
标签: django django-rest-framework static django-admin