簡體   English   中英

找不到 PythonAnywhere 圖像

[英]PythonAnywhere image not found

由於問題與其他問題相似,在任何人刪除此內容之前:其他問題和文檔都沒有讓我的網站按預期工作。

目標:在我的網站上加載圖片

問題:找不到圖片

附加信息:它使用python manage.py runserver在本地工作

我為嘗試修復它所做的工作:

  • 我嘗試遵循靜態文件指南https://help.pythonanywhere.com/pages/DjangoStaticFiles但這不起作用,因為我沒有使用默認的上傳文件處理。

  • 我嘗試在 PythonAnywhere > Web > static 文件選項卡下輸入它,但無法讓它工作。

  • 從 PythonAnywhere 論壇和 SO 論壇嘗試了一堆不同的解決方案,但都沒有讓我的網站正常工作。

站點: http://nasablogdeployment.eu.pythonanywhere.com/

此處提供的所有代碼: https://github.com/MarkdenToom/NASA-blog

Static 文件目錄在這里: https://imgur.com/xL0RN8A

WSGI文件內容: https://imgur.com/dJY4knp

Your web app is looking for the picture in http://nasablogdeployment.eu.pythonanywhere.com/blog/media/thumbnails/Touchdown_Expedition_62_Returns_to_Earth_Completes_Station_Mission.jpg while your current mapping resolves into url like that: http://nasablogdeployment.eu.pythonanywhere.com/media/thumbnails/Touchdown_Expedition_62_Returns_to_Earth_Completes_Station_Mission.jpg

更改您的 static 文件映射,以便/blog/media/指向/home/nasablogdeployment/NASA-blog/blog/media/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM