最近,我的服務器上的資料庫已經破床了。我想這個錯誤出在我的某個地方,我的 wagtail 資料庫最終被清除干凈。我已經設法讓我的 sqlite 資料庫再次作業,但我collectstatic仍然失敗。
我嘗試使用并重新運行重命名我的static檔案夾,但它仍然失敗。mv static staticoldpython manange.py collecstatic
錯誤訊息如下:
Post-processing 'scss/main.css' failed!
...
...
raise ValueError("The file '%s' could not be found with %r." % (filename, self))
ValueError: The file 'images/5f5a5b3515c4dd0c2c455925_110642301_938622823267359_7859124022958180678_n201.jpg' could not be found with <django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at 0x7f00badf6f60>.`
我并不真正關心這些舊影像,盡管我希望我的 js 和 css 檔案能夠更新 collectstatic
uj5u.com熱心網友回復:
你在用ManifestStaticFilesStorage嗎?( STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage')。這聽起來像是在運行時找不到檔案時給出的錯誤collectstatic。如果它在您的設定中,您可以注釋掉該行,然后嘗試運行collectstatic. 然后,您只需確保將找不到的檔案放置到位,或者如果不需要它,則洗掉對它的參考以繼續使用ManifestStaticFilesStorage. 我鼓勵您使用ManifestStaticFilesStorage,因為它確保您在每次部署時都擁有唯一版本的靜態檔案。這可確保用戶始終收到最新版本的靜態檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/417302.html
標籤:
