django报错解决:Invalid HTTP_HOST header: 'xxx.com'. You may need to add u'xxx.com' to ALLOWED_HOSTS.
django版本:1.11.15
使用uwsgi+nginx运行django程序,出现报错,报错为:
Invalid HTTP_HOST header: 'xxx.com:82'. You may need to add u'xxx.com' to ALLOWED_HOSTS.
xxx.com为绑定的测试域名,82为端口
解决办法:
修改项目的setting.py配置文件
将
ALLOWED_HOSTS = []
改为
ALLOWED_HOSTS = ['*']
再次运行可以成功访问了。
django报错解决:Invalid HTTP_HOST header: 'xxx.com'. You may need to add u'xxx.com' to ALLOWED_HOSTS.的更多相关文章
- 配置python+mod_wsgi+apache 时 在浏览器中访问服务器时报错:Invalid HTTP_HOST header: 'XXXXX'. You may need to add u'XXXXX' to ALLOWED_HOSTS,在setting.py中添加‘*”无效的原因
配置python+mod_wsgi+apache 时 在浏览器中访问服务器时报错:Invalid HTTP_HOST header: 'XXXXX'. You may need to add u'XX ...
- ubuntu pip 安装django报错解决
系统版本 ubuntu Kylin 16.04 LTS 安装pip3 安装 Django 总是提示time out,无法安装. 逛了好多论坛终于遭到了解决办法,分享保存: sudo pi ...
- django报错解决:view must be a callable or a list/tuple in the case of include().
django版本:1.11.15 django应用,修改urls.py后,访问报错:TypeError at /view must be a callable or a list/tuple in t ...
- Invalid HTTP_HOST header: 'xxx.xxx:8000'. You may need to add 'xxx.xx' to ALLOWED_HOSTS
用python3 manage.py runserver 0.0.0.0:8000命令运行django程序后,通过浏览器访问服务器网址的8000端口,出现访问错误,报错为 Invalid HTTP_H ...
- Django运行项目时候出现DisallowedHost at / Invalid HTTP_HOST header:
web端错误现象: DisallowedHost at / Invalid HTTP_HOST header: 'ip:8000'. You may need to add u'ip' to ALLO ...
- Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header
Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header: DisallowedHost at / Invalid HTTP_HOS ...
- Django报错:OSError: raw write() returned invalid length 4 (should have been between 0 and 2)
在使用Django时Django报错:Django报错:OSError: raw write() returned invalid length 4 (should have been between ...
- django error: DisallowedHost: Invalid HTTP_HOST header: ''. You may need to add u'' to ALLOWED_HOST
测试环境: [root@nanx-lli ~]# lsb_release -aLSB Version: :core-4.1-amd64:core-4.1-noarchDistributor ID: C ...
- Invalid HTTP_HOST header: 'xxx.xx.xxx.xxx:8000'. You may need to add 'xxx.xx' to ALLOWED_HOSTS
Invalid HTTP_HOST header: 'xxx.xx.xxx.xxx:8000'. You may need to add 'xxx.xx' to ALLOWED_HOSTS - buk ...
随机推荐
- jmeter中添加压力机
在压测的时候,可能并发比较大,一台机子已经启动不了那么多并发了,这个时候就是有多台机子一起来并发,就要添加压力机 如何添加压力机呢: 1.其他电脑上也安装了jmeter,和其他电脑都能ping通当前电 ...
- <Impala><Overview><UDF>
Overview Apache Impala (incubating) is the open source, native analytic database for apache Hadoop. ...
- shell脚本实例-内存磁盘使用警告
1,磁盘使用警告并发送邮件 #!usr/bin/bash #df -Th|grep '/$' 这个是获取内存使用的那一条记录 #后面两句是获取内存的使用率 disk=`df -Th|grep '/$' ...
- LVS原理详解(3种工作方式8种调度算法)
一.集群简介 什么是集群 计算机集群简称集群是一种计算机系统,它通过一组松散集成的计算机软件和/或硬件连接起来高度紧密地协作完成计算工作.在某种意义上,他们可以被看作是一台计算机.集群系统中的单个计算 ...
- 17 多校1 Add More Zero 水题
Problem Description There is a youngster known for amateur propositions concerning several mathemati ...
- 常用文本编辑器 editor 的常用插件 —— CopyEdit
1. CopyEdit http://www.conyedit.com/, 跨平台的文本编辑器插件: 监控粘贴板以及支持命令解析 其官网上有其动图演示:
- jquery 获取访问当前页面的开源设备信息
<!DOCTYPE html> <html> <head> <title>测试js</title> <meta http-equiv= ...
- [LeetCode&Python] Problem 696. Count Binary Substrings
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of ...
- Gym.101955: Asia Shenyang Regional Contest(寒假自训第10场)
C.Insertion Sort 题意:Q次询问,每次给出N,M,Mod,问你有多少种排列,满足前面M个数字排序之后整个序列的LIS>=N-1. 思路:我们把数字看成[1,M],[N-M+1,N ...
- 20155208 《Java程序设计》实验一(Java开发环境的熟悉)实验报告
20155208 <Java程序设计>实验一(Java开发环境的熟悉)实验报告 一.实验内容及步骤 (一)使用JDK编译.运行简单的java程序 命令行下的程序开发 打开windows下的 ...