Request Method: GET
Request URL: http://202.201.38.70:8000/angular
Django Version: 1.11.3
Exception Type: DisallowedHost
Exception Value:
Invalid HTTP_HOST header: '202.201.38.70:8000'. You may need to add '202.201.38.70' to ALLOWED_HOSTS.
Exception Location: /usr/local/python3/lib/python3.6/site-packages/Django-1.11.3-py3.6.egg/django/http/request.py in get_host, line 113
Python Executable: /usr/local/python3/bin/python3
Python Version: 3.6.1
Python Path:
['/var/www/html/application/mysite',
'/usr/local/python3/lib/python36.zip',
'/usr/local/python3/lib/python3.6',
'/usr/local/python3/lib/python3.6/lib-dynload',
'/usr/local/python3/lib/python3.6/site-packages',
'/usr/local/python3/lib/python3.6/site-packages/Django-1.11.3-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/pytz-2017.2-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/PyMySQL-0.7.11-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/django_tokenapi-1.0-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/xlrd-1.0.0-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/python_dateutil-2.6.1-py3.6.egg',
'/usr/local/python3/lib/python3.6/site-packages/six-1.10.0-py3.6.egg']
Server time: Tue, 29 Aug 2017 09:56:31 +0000

运行项目时,输入命令#Python manage.py runserver 192.168.1.111:8000,在本机的浏览器中输入http://192.168.1.111:8000

在我们创建的项目里修改setting.py文件

找到ALLOWED_HOSTS ,在[]里添加*

ALLOWED_HOSTS = ['*']  #在这里请求的host添加了*

运行django项目出现Invalid HTTP_HOST header: '192.168.1.111:8000'. You may need to add '192.168.1.111' to ALLOWED_HOSTS的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header

    Django运行访问项目出现的问题:DisallowedHost at / Invalid HTTP_HOST header: DisallowedHost at / Invalid HTTP_HOS ...

  4. 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 ...

  5. 访问Django项目出现DisallowedHost at / Invalid HTTP_HOST header问题

    闲来无事,想玩玩django,源码安装碰到了一堆乱七八糟依赖性问题,耗费一下午的时间总算是在ubuntu14.04上搭建好了python3+django2开发环境, 心血来潮,创建了一个django项 ...

  6. Django运行访问项目出现的问题:Invalid HTTP_HOST header: '192.168.114.25:8001'. You may need to add u'192.168.114.25' to ALLOWED_HOSTS.

    当运行python manage.py runserver 0.0.0.0:8001时候,出现Invalid HTTP_HOST header: '192.168.114.25:8001'. You ...

  7. 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 ...

  8. 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 ne ...

  9. 无效的HTTP_主机头Invalid HTTP_HOST header: '192.168.56.100:8888'. You may need to add '192.168.56.100' to ALLOWED_HOSTS.

    Invalid HTTP_HOST header: '192.168.56.100:8888'. You may need to add '192.168.56.100' to ALLOWED_HOS ...

随机推荐

  1. LaTex初学

    先用三句话来介绍什么是LaTeX:1.LaTeX是一类用于编辑和排版的软件,用于生成PDF文档.2.LaTeX编辑和排版的核心思想在于,通过\section和\paragraph等语句,规定了每一句话 ...

  2. 【DUBBO】Dubbo原理解析-服务发布

    转载:http://blog.csdn.net/quhongwei_zhanqiu/article/details/41651205 服务发布方在spring的配置文件中配置如下: <bean ...

  3. spring cloud feign 接口继承以及参数传递的问题

    1. 优势     可以使用maven 进行访问,实现代码的共享,减少跨服务调用服务编写的问题   2. 使用      定义接口 publicinterfaceIUserService{ @Requ ...

  4. RK3288 USB触摸屏与USB摄像头同时使用时触摸卡顿

    CPU:RK3288 系统:Android 5.1 当USB触摸屏与USB摄像头同时使用时,有时会出现触摸卡顿,看似按键按下没有弹起. getevent 查看触摸屏上报,只有 DOWN,没有 UP,正 ...

  5. Mybatis数据的增删改查

    数据: Student{id int,name String ,age int} 配置mybatis-config.xml <?xml version="1.0" encod ...

  6. 使用maven打包额外的jar

    当使用maven打包的时候,部分自己的额外使用的在maven基础库里面是没有的时候: 参考:  https://blog.csdn.net/hguisu/article/details/5107268 ...

  7. springboot+idea 热部署

    1 配置pom.xml <!--spring-boot-devtools 热部署--> <dependency> <groupId>org.springframew ...

  8. postman关联 (含获取请求头的方法)

    在Tests里面输入脚本 var jsonData = JSON.parse(responseBody);postman.setEnvironmentVariable("message&qu ...

  9. 微信APP支付整体流程记录备忘

      支付整体流程见文档:https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=8_3   商户系统和微信支付系统主要交互说明:     步骤1: ...

  10. Linux系统启动流程与系统目录

    启动流程 # 1,开机BIOS自检 检查一系列的硬件,最后根据启动顺序启动,是硬盘还是光驱等 # 2,MBR引导 读硬盘0柱面0磁道1扇区的前446字节 1扇区=512字节 MBR=4446字节 四个 ...