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. python爬虫之PyQuery的基本使用

    PyQuery库也是一个非常强大又灵活的网页解析库,如果你有前端开发经验的,都应该接触过jQuery,那么PyQuery就是你非常绝佳的选择,PyQuery 是 Python 仿照 jQuery 的严 ...

  2. python爬虫之requests的基本使用

    简介 Requests是用python语言基于urllib编写的,采用的是Apache2 Licensed开源协议的HTTP库,Requests它会比urllib更加方便,可以节约我们大量的工作. 一 ...

  3. python之路--动态传参,作用域,函数嵌套

    一 . 动态传参(重点)  * ,  ** * 与 ** * 在形参位置. * 表示不定参数, 接收的是位置参数 接收到的位置参数的动态传参: 都是元组 def eat(*food): # 在形参这里 ...

  4. 手把手制作一个简单的IDEA插件(环境搭建Demo篇)

    新建IDEA插件File --> new --> Project--> Intellij PlatForm Plugin-->Next-->填好项目名OK 编写插件新建工 ...

  5. springboot swagger2 泛型踩坑记

    最近使用一些工具需要和swagger打通,swagger的格式总是不对. 后来查了一下:哈哈. https://blog.csdn.net/hupingjin/article/details/8299 ...

  6. vue ajax

    局部get: this.$http.get(url,{param:jsonData}).then(successCallback,failCallBack) 局部post: this.$http.po ...

  7. SQL to JSON Data Modeling with Hackolade

    Review: SQL to JSON data modeling First, let’s review, the main way to represent relations in a rela ...

  8. 错误代码 0x800700b7 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler”节

    如果是运行VS时就报错,改个端口号就可以解决问题,改完以下两个地方重新运行

  9. 适用于Centos6.x系统的15项优化脚本

    1#!/bin/bash 2# Date: 2018-6-8 3#version:1.2 4#实现功能:一键系统优化15项脚本,适用于Centos6.x 5###################### ...

  10. mfs 使用心得

    CentOS的安装方法: To install MooseFS from officially supported repository on EL7, follow the steps below: ...