pythonanywhere // python manage.py collectstatic = 0将静态文件复制到// 175未经修改

时间:2019-12-05 23:10:46

标签: python django pythonanywhere

为什么我的静态文件无法加载?

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/'

我需要页面上的模板,但是我不知道自己在做什么错。路线应该正确,不要误会

1 个答案:

答案 0 :(得分:0)

static_root代替

STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), '/var/www/static/', ]

您可以使用