无法使用Django新建项目:'django-admin.py’不是内部或外部命令
找到site-packages/django/bin(如 D:\Program Files\Anaconda3\Lib\site-packages\django\bin),把这个路径加入系统环境变量中。

error: unrecognized arguments: getall
原因:django版本和代码里的requirements.txt要求的不符
解决:重装django制定版本的代码

要用 pip 安装指定版本的 Python 包,只需通过 == 操作符 指定
pip install robotframework==2.8.7
将安装robotframework 2.8.7 版本。

‘WSGIRequest’ object has no attribute ‘user’
这是Django版本的问题,
1.9之前,中间件的key为MIDDLEWARE_CLASSES,
1.9之后,为MIDDLEWARE。
所以在开发环境和其他环境的版本不一致时,要特别小心,会有坑。需要在settings里面把MIDDLEWARE改为MIDDLEWARE_CLASSES 即可

TypeError at / ‘bool’ object is not callable
使用 Django自带的 auth 用户验证功能,编写函数,使用 is_authenticated 检查用户是否登录报错

def index(request, pid=None, del_pass=None):
  if request.user.is_authenticated():
    username = request.user.username
    useremail = request.user.email
  messages.get_messages(request)
  template = get_template('index.html')
  html = template.render(context=locals(), request=request)
  return HttpResponse(html)

查询相关资料,发现 is_authenticated 是属性而不是方法,我们应该把括号去掉,这样就没什么问题了。

将 if request.user.is_authenticated(): 改为 if request.user.is_authenticated:

错误编码1050

python manage.py migrate myapp --fake # 数据库表结构同步成功

错误编码1146
  1.同步数据库
    项目建起来后,同步数据库,加入自定义的app 

python manage.py syncdb

  2.创建初始的迁移脚本

python manage.py makemigrations appname

  3.同步迁移数据库    

python manage.py migrate appname

user.User.basemodel_ptr: (fields.E300) Field defines a relation with model ‘BaseModel’, which is either not installed, or is abstract.

Django-报错解决方法的更多相关文章

  1. django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法

    django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法 django.db ...

  2. eclipse创建的maven项目,pom.xml文件报错解决方法

    [错误一:]maven 编译级别过低 [解决办法:] 使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上: <!-- java编译插件 --> ...

  3. MyEclipse Server view报错解决方法

    MyEclipse Server view报错解决方法 方法/步骤     启动MyEclipse,弹出一个框,报错. ---------------------------------------- ...

  4. Loadrunner参数化逗号报错解决方法

    Loadrunner参数化逗号报错解决方法     介绍Loadrunner参数化时,参数中包含有逗号时出错的解决方法. 在Loadrunner进行参数化时,参数中如果含有逗号,编辑保存后会报错: 此 ...

  5. Android Studio support 26.0.0-alpha1 Failed to resolve: com.android.support:appcompat-v7:27.+ 报错解决方法

    AS下如何生成自定义的.jks签名文件, 以及如何生成数字签名 链接:http://www.cnblogs.com/smyhvae/p/4456420.html 链接:http://blog.csdn ...

  6. iOS url带中文下载时 报错解决方法

    问题描述:下载文件时, 请求带中文的URL的资源时,比如:http://s237.sznews.com/pic/2010/11/23/e4fa5794926548ac953a8a525a23b6f2/ ...

  7. jquery jssdk分享报错解决方法

    jssdk分享报错解决方法 一般都是参数传错了

  8. create-react-app创建项目后,运行npm run eject报错解决方法

    运行npm run eject报错解决方法 主要问题是脚手架添加.gitgnore文件,但是却没有本地仓库,使用以下命令操作以下就可以了 git init git add . git commit - ...

  9. 打开struts-config.xml 报错 解决方法Could not open the editor

    打开struts-config.xml 报错 解决办法Could not open the editor 错误信息:Could not open the editor: Project XXX is ...

  10. CitrixSmartAuditor安装报错解决方法

    报错1:安装过程中报错 解决方法: SQLServer的配置: http://www.cnblogs.com/weizhengLoveMayDay/p/3267756.html 报错2:无法连接到Sm ...

随机推荐

  1. bzoj 4337 树的同构

    4337: BJOI2015 树的同构 Description 树是一种很常见的数据结构. 我们把N个点,N-1条边的连通无向图称为树. 若将某个点作为根,从根开始遍历,则其它的点都有一个前驱,这个树 ...

  2. [noip模拟赛]bird

    https://www.zybuluo.com/ysner/note/1295414 题面 \(R\)是一个猎人,他准备打猎,他站在平面直角坐标系的\((0,0)\)位置. 天上有\(n\)只小鸟从右 ...

  3. openStack集群封装记录

  4. Java实现二叉树遍历

    参考资料: http://blog.csdn.net/wuwenxiang91322/article/details/12231657 环境: Java: jdk1.8.0_91 import jav ...

  5. 为了一个句号,写了好多行的代码——值!(html 表单的处理)

    个人信息表 <span style="font-size:18px;"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML ...

  6. 汇编程序52:实验15 安装新的int9中断例程

    assume cs:code ;重写int9中断例程,当按住a后松开,便会产生满屏A stack segment dw dup() stack ends code segment start: mov ...

  7. 生成自签名ca 证书 使nginx 支持https

    创建服务器私钥,命令会让你输入一个口令:$ openssl genrsa -des3 -out server.key 1024创建签名请求的证书(CSR):$ openssl req -new -ke ...

  8. 洛谷 P2090 数字对

    发现如果给定两个数(a,b),可以用类似辗转相除法在logn的时间内计算出(反向)变到(1,1)的最小步数. 然而并不知道另一个数是多少? 暴力嘛,枚举一下另一个数,反正1000000的nlogn不虚 ...

  9. Using 10053 Trace Events and get outline

    When it comes to performance tuning, we can spend time on one or both ends of the problem. On the &q ...

  10. 3122 奶牛代理商 VIII

    3122 奶牛代理商 VIII 时间限制: 3 s 空间限制: 256000 KB 题目等级 : 大师 Master       题目描述 Description 小徐是USACO中国区的奶牛代理商, ...