Django FileNotFoundError:[WinError 3]系统找不到指定的路径:';C:\\Users\\ivan\\Desktop\\Python\\static';
我正在尝试安装django调试工具栏来跟踪数据库中的ORM查询。 有这个吗Django FileNotFoundError:[WinError 3]系统找不到指定的路径:';C:\\Users\\ivan\\Desktop\\Python\\static';,python,django,collectstatic,Python,Django,Collectstatic,我正在尝试安装django调试工具栏来跟踪数据库中的ORM查询。 有这个吗 WARNINGS: ?: (debug_toolbar.staticfiles.W001) debug_toolbar requires the STATICFILES_DIRS directories to exist. HINT: Running manage.py collectstatic may help uncover the issue. 决定运行python manage.py col
WARNINGS:
?: (debug_toolbar.staticfiles.W001) debug_toolbar requires the STATICFILES_DIRS directories to exist.
HINT: Running manage.py collectstatic may help uncover the issue.
决定运行python manage.py collectstatic并获取错误
这是设置文件
设置.py
INSTALLED_APPS = [
#...
'django.contrib.staticfiles',
#..
'debug_toolbar',
]
MIDDLEWARE = [
#...
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
# ...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': str(os.path.join(BASE_DIR, "db.sqlite3")),
}
}
# ....
STATIC_URL='/static/'
STATICFILES_DIRS =[
os.path.join(BASE_DIR,'static').replace("\\", "/"),
]
我不需要在
STATICFILES\u DIRS
中使用replace方法,只需使用os.path.join(BASE\u DIR,'static')
我以前没有使用过它。反正也没用