老师,压缩静态文件报错

来源:12-16 Nginx+Gunicorn+Daphne部署Django Channels应用

鲨鱼辣椒辣

2021-04-21

(zanhuenv) [root@localhost zanhu]# python3 manage.py collectstatic

You have requested to collect static files at the destination
location as specified in your settings:

    /root/zanhu/zanhu/static

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Found another file with the destination path 'markdownx/admin/css/markdownx.css'. 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 'markdownx/admin/css/markdownx.min.css'. 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 'markdownx/js/markdownx.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.
Found another file with the destination path 'markdownx/js/markdownx.min.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.
Found another file with the destination path 'debug_toolbar/css/print.css'. 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 'debug_toolbar/css/toolbar.css'. 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 'debug_toolbar/img/ajax-loader.gif'. 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 'debug_toolbar/img/indicator.png'. 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 'debug_toolbar/js/redirect.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.
Found another file with the destination path 'debug_toolbar/js/toolbar.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.
Found another file with the destination path 'debug_toolbar/js/toolbar.timer.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.
Found another file with the destination path 'django_extensions/css/jquery.autocomplete.css'. 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 'django_extensions/img/indicator.gif'. 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 'django_extensions/js/jquery.ajaxQueue.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.
Found another file with the destination path 'django_extensions/js/jquery.autocomplete.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.
Found another file with the destination path 'django_extensions/js/jquery.bgiframe.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.

121 static files copied to '/root/zanhu/zanhu/static', 1 unmodified.
(zanhuenv) [root@localhost zanhu]#  python3 manage.py compress --force
Found 'compress' tags in:
	/root/zanhu/zanhu/templates/account/password_set.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/login.html
	/root/zanhu/zanhu/templates/articles/article_detail.html
	/root/zanhu/zanhu/templates/qa/answer_form.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/verified_email_required.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/socialaccount/login_cancelled.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_reset_from_key_done.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_reset_from_key.html
	/root/zanhu/zanhu/templates/account/logout.html
	/root/zanhu/zanhu/templates/account/login.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/openid/login.html
	/root/zanhu/zanhu/templates/articles/article_create.html
	/root/zanhu/zanhu/templates/account/password_reset.html
	/root/zanhu/zanhu/templates/news/news_list.html
	/root/zanhu/zanhu/templates/qa/question_list.html
	/root/zanhu/zanhu/templates/account/verification_sent.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/email.html
	/root/zanhu/zanhu/templates/articles/article_update.html
	/root/zanhu/zanhu/templates/qa/question_form.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_set.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/signup_closed.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/verification_sent.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/email_confirm.html
	/root/zanhu/zanhu/templates/account/base.html
	/root/zanhu/zanhu/templates/account/signup_closed.html
	/root/zanhu/zanhu/templates/400.html
	/root/zanhu/zanhu/templates/pages/home.html
	/root/zanhu/zanhu/templates/users/user_detail.html
	/root/zanhu/zanhu/templates/account/password_change.html
	/root/zanhu/zanhu/templates/qa/question_detail.html
	/root/zanhu/zanhu/templates/account/signup.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/socialaccount/connections.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/socialaccount/base.html
	/root/zanhu/zanhu/templates/403_csrf.html
	/root/zanhu/zanhu/templates/base.html
	/root/zanhu/zanhu/templates/search/search.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/logout.html
	/root/zanhu/zanhu/templates/403.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_change.html
	/root/zanhu/zanhu/templates/articles/article_list.html
	/root/zanhu/zanhu/templates/search/search_results.html
	/root/zanhu/zanhu/templates/pages/about.html
	/root/zanhu/zanhu/templates/account/email.html
	/root/zanhu/zanhu/templates/account/password_reset_done.html
	/root/zanhu/zanhu/templates/account/password_reset_from_key.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/socialaccount/signup.html
	/root/zanhu/zanhu/templates/news/news_confirm_delete.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/signup.html
	/root/zanhu/zanhu/templates/messager/message_list.html
	/root/zanhu/zanhu/templates/account/password_reset_from_key_done.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/account_inactive.html
	/root/zanhu/zanhu/templates/notifications/notification_list.html
	/root/zanhu/zanhu/templates/500.html
	/root/zanhu/zanhu/templates/account/account_inactive.html
	/root/zanhu/zanhu/templates/users/user_form.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_reset.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/password_reset_done.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/socialaccount/authentication_error.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/openid/base.html
	/root/zanhu/zanhu/templates/account/verified_email_required.html
	/root/.virtualenvs/zanhuenv/lib/python3.6/site-packages/allauth/templates/account/base.html
	/root/zanhu/zanhu/templates/404.html
	/root/zanhu/zanhu/templates/account/email_confirm.html
**CommandError: An error occurred during rendering /root/zanhu/zanhu/templates/account/password_set.html: 'js/zanhu.js' could not be found in the COMPRESS_ROOT '/root/zanhu/zanhu/static' or with staticfiles.**

写回答

1回答

Jack

2021-04-21

'js/zanhu.js' could not be found in the COMPRESS_ROOT '/root/zanhu/zanhu/static' or with staticfiles.**

报错提示, 是不是没这个文件呢

0
1
鲨鱼辣椒辣
非常感谢!
2021-04-22
共1条回复

Django高级实战 开发企业级问答网站

融合Django高级用法/算法/设计模式/TestCase测试/云计算打造项目

900 学习 · 756 问题

查看课程