在settings.py中添加
STATICFILES_DIRS
STATIC_URL = 'static/' #STATIC_ROOT = os.path.join(BASE_DIR, 'static') <----- comment this line STATICFILES_DIRS = [BASE_DIR / 'static'] <----- add this line