我正在用Django构建项目。 Django项目的层次结构:
-library
-assets
-library
-frontend
-manage.py
我以与settings.py相同的方向创建了production_settings.py。
当我运行下面的命令时,我刚得到一个错误:
Error reading /Desktop/Library/library/webpack-stats.prod.json. Are you sure webpack has generated the file and the path is correct?
命令:
python3 manage.py runserver --settings = library.production_settings
production_settings.py: 来自.settings import *
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "assets"),
]
STATIC_URL = '/static/'
WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(BASE_DIR, 'webpack- stats.prod.json'),}}