我在pythonanywhere.com上臨時託管我的網站使django網站生效後不顯示靜態內容?
但我不明白爲什麼靜態內容沒有顯示。我對pythonanywhere.com settings.py是:
STATIC_ROOT = u'/home/baqir/ProgrammersForum/main/static/'
STATIC_URL = '/static/'
而且在我的本地是:pythonanywhere.com的
STATIC_URL = '/static/'
截圖:
在localhost截圖:
該網址是正確的。我究竟做錯了什麼?
PS:我也跑蟒蛇manage.py collectstatic
Django不喜歡什麼生產靜態的,但你可以得到它通過使用'--insecure'當你開始你的服務器來運行。 – GreenSaber
你的意思是'python manage.py --insecure'? –
'python manage.py runserver x.x.x.x --insecure'。然而這對於生產來說是一個壞主意。 – GreenSaber