Ubuntu下,运行django项目的时候失败,报错:

(env36) root@JD:~/xueyiwang# python manage.py runserver 0.0.0.0:8000
Performing system checks... Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f47dd74a950>
Traceback (most recent call last):
File "/root/env36/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/root/env36/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "/root/env36/lib/python3.6/site-packages/django/core/management/base.py", line 410, in check
raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: ERRORS:
?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.

错误原因有可能是在settings中静态文件目录设置的有问题

STATIC_ROOT=os.path.join(BASE_DIR,"static/")#错误
STATIC_ROOT=os.path.join(BASE_DIR,"/static/")#正确

ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.的更多相关文章

  1. django 报错 : django.core.exceptions.ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting

    错误原因有可能是在settings中静态文件目录设置的有问题 STATIC_ROOT=os.path.join(BASE_DIR,"static/")#错误 STATIC_ROOT ...

  2. Maven出现User setting file does not exist ...\.m2\setting.xml的问题解决(同时也解决用户.m2目录下无setting.xml文件)

    如果Eclipse中出现User setting file does not exist ...\.m2\setting.xml这样的问题,解决方法如下: 1.拷贝%M2_HOME%/conf/set ...

  3. 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 中添加这一句话则可以解决 STATIC_ROOT = os.path.join(BASE_DIR, 'static') 测试不在有问题

  4. Django设置 DEBUG=False后静态文件无法加载解决

    前段时间调试一直是在Debug=True先运行的,没有什么问题.今天关闭了Debug后,出现了一个问题.就是静态文件找不到了,「img.css.js」都提示404,无法准确的访问 static 静态文 ...

  5. django源码分析——静态文件staticfiles中间件

    本文环境python3.5.2,django1.10.x系列 1.在上一篇文章中已经分析过handler的处理过程,其中load_middleware就是将配置的中间件进行初始化,然后调用相应的设置方 ...

  6. pythonのdjango

    Django(醤糕) 是基于MTV的框架 安装: pip3 install django 重要性:相当于出门带不带腿 创建工程 django-admin startproject [工程名称] 工程目 ...

  7. 在pythonanywhere.com免费网站建立虚拟机环境以及django网站

    注册,添加App,选择python3.5,然后打开控制台 搭建python3.5虚拟环境 python --version virtualenv -p /usr/bin/python3.5 VENV ...

  8. django模板导入外部js和css等文件

    1.新建文件夹templates(存放模板文件),新建文件夹media(存放js.css.images文件夹),并把两个文件夹放到了项目的根目录下 2.设定模板路径 设置模板路径比较简单,只要在set ...

  9. django核心配置项

    Django的默认配置文件中,包含上百条配置项目,其中很多是我们‘一辈子’都不碰到或者不需要单独配置的,这些项目在需要的时候再去查手册. 强调:配置的默认值不是在settings.py文件中!不要以为 ...

随机推荐

  1. Oracle 中sql文件的导入导出

    导出 一般导入的时候我用的是命令行 imp c##zs/@orcl fromuser=c##zs touser=c##zs file=D:\java\.dmp ignore=y c##zs 是创建的用 ...

  2. PermGen space 内存溢出

    1.修改D:\tools\tomcat\tomcat - 7\apache-tomcat-7.0.91\bin tomcat 路径下bin 文件的catalina.bat文件 添加 JAVA_OPTS ...

  3. 用mescroll实现无限上拉增加数据,下拉刷新数据 (学习笔记)

    最近自己做一个web app需要用到上拉查询下页数据,网上看了很多很多帖子,发现并不能快速的套用,总是会出现各种问题无法使用,于是无奈自己跑去看了官方api文档,终于做了出来,至此做个笔记,以后用到可 ...

  4. 莫烦scikit-learn学习自修第六天【特征值矩阵标准化】

    1.代码实战 #!/usr/bin/env python #!_*_coding:UTF-8 _*_ import numpy as np from sklearn import preprocess ...

  5. PDO访问Mysql数据库

    $dsn = 'mysql:host=127.0.0.1;dbname=myblog'; $username = 'root'; $pwd = '; $pdo = new PDO($dsn,$user ...

  6. python 读取csv 数据并画图分析

    数据源 : https://pan.baidu.com/s/1eR593Uy    密码: yqjh python环境 python3 #encoding: utf-8 import csv impo ...

  7. 转载 -- CSS3 中关于 select 下拉列表的样式

    截图效果:

  8. Spring Boot 构建电商基础秒杀项目 (十一) 秒杀

    SpringBoot构建电商基础秒杀项目 学习笔记 新建表 create table if not exists promo ( id int not null auto_increment, pro ...

  9. endnote中文格式“,等”的修改

    https://www.howsci.com/endnote-eng-cn-refer-etal.html

  10. 【转】微信小程序开发之图片等比例缩放 获取屏幕尺寸图片尺寸 自适应

    原文[https://blog.csdn.net/qq_31383345/article/details/53127804] 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于 ...