我暂时在pythonanywhere.com上托管了我的网站
但我不明白为什么静态内容没有显示。我在pythonanywhere.com上的settings.py是:
STATIC_ROOT = u'/home/baqir/ProgrammersForum/main/static/'
STATIC_URL = '/static/'
在我的本地主机上是:
STATIC_URL = '/static/'
pythonanywhere.com的屏幕截图:
localhost上的屏幕截图:
网址是正确的。我做错了什么?
PS:我还运行了python manage.py collectstatic
答案 0 :(得分:-1)
进行这些更改。
Alias /media/ /path/to/mysite.com/media/
Alias /static/ /path/to/mysite.com/static/
<Directory /path/to/mysite.com/static>
Require all granted
</Directory>
<Directory /path/to/mysite.com/media>
Require all granted
</Directory>