【发布时间】:2021-06-14 13:50:08
【问题描述】:
我不知道是什么问题,我什么都试了还是不明白,这种情况应该怎么办,请看一下
Setting.py 当我这样做时:
STATIC_URL = '/static/'
STATICFILES_DIRS = os.path.join(BASE_DIR, 'static')
MEDIA_URL ='/images/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')
显示这个错误
ERRORS:
?: (staticfiles.E001) The STATICFILES_DIRS setting is not a tuple or list.
HINT: Perhaps you forgot a trailing comma?
Setting.py 当我这样做时:
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'),]
MEDIA_URL ='/images/'
MEDIA_ROOT = [os.path.join(BASE_DIR, 'static/images'),]
显示这个错误
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not list
[17/Mar/2021 13:27:59] "POST /admin/admission/personal/add/ HTTP/1.1" 500 211689
谁能帮忙??
【问题讨论】:
标签: python-3.x django django-models django-settings