ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT settin

Posted xuepangzi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT settin相关的知识,希望对你有一定的参考价值。

Ubuntu下,运行django项目的时候失败,报错:

(env36) [email protected]:~/xueyiwang# python manage.py runserver 0.0.0.0:8000 
Performing system checks...

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f47dd74a950>
Traceback (most recent call last):
  File "/root/env36/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/root/env36/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
    self.check(display_num_errors=True)
  File "/root/env36/lib/python3.6/site-packages/django/core/management/base.py", line 410, in check
    raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.

错误原因有可能是在settings中静态文件目录设置的有问题

STATIC_ROOT=os.path.join(BASE_DIR,"static/")#错误
STATIC_ROOT=os.path.join(BASE_DIR,"/static/")#正确

 

以上是关于ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT settin的主要内容,如果未能解决你的问题,请参考以下文章

Go 源码解读|如何用好 errors 库的 errors.Is() 与 errors.As() 方法

slave-skip-errors

Errors occurred during the build. Errors occurred during the build. Errors running builder 'Java

pymongo.errors.BulkWriteError: batch op errors occurred

"errors":"errors":["detail":"您无权执行此操作。","code":&qu

KnockOut.js 验证始终为真/errors.length = 0