Python及Django学习错误与解决

来源:互联网 发布:网络监控监控的是什么 编辑:程序博客网 时间:2024/06/11 09:12

2017/11/03

问题:

示错误

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

解决办法:

在C:\Users\目录下,新建pip文件夹,然后创建pip.ini,内容为:

[list]format=columns

2017/11/05

提示错误:

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

解决办法:

在settings.py中增加:

STATIC_ROOT = os.path.join(BASE_DIR, 'static')


2017/11/11

错误:

CSS样式丢失

解决办法:

在settings.py中增加:

STATICFILES_DIRS=[    os.path.join(BASE_DIR,'static')]STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static')