Django静态文件路径设置

提示 :

Error fetching command 'collectstatic': You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
Command 'collectstatic' skipped

 

解决方法:settings.py添加

 

1 STATIC_ROOT = os.path.join(BASE_DIR, '/static/')
2 
3 STATIC_URL = '/static/'
4 STATICFILES_DIRS = [
5     os.path.join(BASE_DIR,'static')
6 ]

 

posted @ 2018-02-20 13:06  AntzUhl  阅读(753)  评论(0编辑  收藏  举报