最近做一个django项目,在设置了 DEBUG=False之后,访问接口,报错400.  何解???

    查资料,得知:    

                            400报错主要有两种:

1、bad request 意思是“错误的请求";

2、invalid hostname 意思是"不存在的域名”。

    解决: settings.py文件中,设置ALLOW_HOSTS = ['*']

django 400报错的更多相关文章

  1. python---补充django中文报错(1),Django2.7使用sys.setdefaultencoding('utf-8'),以及使用reload(sys)原因

    SyntaxError at /blog/ news/story Non-ASCII character , but no encoding declared; see http://python.o ...

  2. http 400报错

    http 400报错---springmvc相关: 1.使用了json入参,传递给了对象,如果对象里的属性,如这里的Bonus是int类型,你传入了非int类型,这里就会报400 2.使用了@Requ ...

  3. django运行报错TypeError: object supporting the buffer API required

    运行django项目报错:TypeError: object supporting the buffer API required 解决方案: 将settings.py中数据库的密码改成字符串格式 源 ...

  4. Django独有报错的原因和解决

    RuntimeError at /login You called this URL via POST, but the URL doesn't end in a slash and you have ...

  5. django程序报错CSRF verification failed. Request aborted.

    django程序的html页面中form的method='post'的时候报错 Forbidden (403) CSRF verification failed. Request aborted.He ...

  6. Django学习报错记录

    1. 运行manage.py任务  makemigrations时,报错: doesn't declare an explicit app_label and isn't in an applicat ...

  7. Django 调用报错 " ImportError: Couldn't import Django. "

    系统炸了导致不得已重装 安装 Django后 利用ORM 创建表的时候报错 Traceback (most recent call last): File "manage.py", ...

  8. django ajax报错解决:You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set.

    Django版本号:1.11.15 django中ajax请求报错:You called this URL via POST, but the URL doesn't end in a slash a ...

  9. Python Django migrate 报错解决办法

    1. 在现有基础上又添加一个表的时候migrate报错 migrate报错django.db.utils.OperationalError: (1050, "Table 'cmdb_eidc ...

随机推荐

  1. [PAT] A1019 General Palindromic Number

    [题目] https://pintia.cn/problem-sets/994805342720868352/problems/994805487143337984 题目大意:给定一个N和b,求N在b ...

  2. Oracle Solaris 10 重启后提示 Bad PBR sig

    Solaris 10 安装完毕重启后提示 Bad PBR sig 在磁盘分区的时候,默认自带的 overlap 不要删除,否则启动报错. 分区时,保留overlap(默认显示总容量大小)分区.安装操作 ...

  3. P3329 [ZJOI2011]最小割

    题目描述 小白在图论课上学到了一个新的概念--最小割,下课后小白在笔记本上写下了如下这段话: 对于一个图,某个对图中结点的划分将图中所有结点分成两个部分,如果结点 s 和 t 不在同一个部分中,则称这 ...

  4. react-native简单使用

    基本组件的使用介绍 View: Text: TextInput: Image: Button: ActivityIndicator: ScrollView:这是一个列表滚动的组件 ListView:也 ...

  5. substring && substr

    let string = '0123456';string.substring(0,3);//start: number, end?: number 012(而非 0123)string.substr ...

  6. 0002 PyCharm设置

    1 设置编码格式 File/Settings/Editor/File Encodings 2 设置字体 File/Settings/Editor/Font 3 鼠标滚轮改变编辑器字体大小 File/S ...

  7. P1002 过河卒【dp】

    P1002 过河卒 题目描述 棋盘上AAA点有一个过河卒,需要走到目标BBB点.卒行走的规则:可以向下.或者向右.同时在棋盘上CCC点有一个对方的马,该马所在的点和所有跳跃一步可达的点称为对方马的控制 ...

  8. Codeforce 567A - Lineland Mail

    All cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its ...

  9. mysql 基础sql语法总结 (二)DML

    二.DML(增.删.改) 1)插入数据 第一种写法:INSERT INTO 表名 (列名1,列名2,,......)VALUES(列值1,列值2,......) 第二种写法:INSERT INTO 表 ...

  10. linux执行计划任务at命令

    https://www.jianshu.com/p/17f5aa01853f 在linux计划任务中, cron 是周期性运行某任务,假如我只想在未来的某时间点只是要求任务运行一次,这就用到at命令了 ...