【发布时间】:2019-12-05 23:10:46
【问题描述】:
为什么我的静态文件无法加载?
CMD
/PruebaApettito.FINAL/PruebaApettito.FINAL-master/Prueba2/proyectoapettito (master)$ python manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings:
/home/sagutierrezr95/PruebaApettito.FINAL/PruebaApettito.FINAL-master/Prueba2/proyectoapettito/AppApettito/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Found another file with the destination path 'admin/js/collapse.min.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
...
0 static files copied to '/home/sagutierrezr95/PruebaApettito.FINAL/PruebaApettito.FINAL-master/Prueba2/proyectoapettito/AppApettito/static', 175 unmodified.
设置
ALLOWED_HOSTS = ['sagutierrezr95.pythonanywhere.com']
STATIC_URL = '/static/'
STATIC_ROOT = '/home/sagutierrezr95/PruebaApettito.FINAL/PruebaApettito.FINAL-master/Prueba2/proyectoapettito/AppApettito/static/'
我需要页面上的模板,但我不知道我做错了什么。路线应该是正确的,没有拼写错误
【问题讨论】:
-
你的问题是什么?
-
为什么我的静态文件无法加载
-
嗨萨尔瓦多,这个答案有帮助吗? stackoverflow.com/questions/35571256/… - 你的 INSTALLED_APPS 是什么样的?
标签: python django pythonanywhere