Django部署-创新互联
django-admin.py startproject HelloWorld
创新互联公司主要企业基础官网建设,电商平台建设,移动手机平台,小程序开发等一系列专为中小企业按需网站设计产品体系;应对中小企业在互联网运营的各种问题,为中小企业在互联网的运营中保驾护航。cd HelloWorld
python manage.py runserver 119.23.175.75:8000
报错:
[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py runserver 119.23.175.75:8000 Performing system checks... System check identified no issues (0 silenced). You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run 'python manage.py migrate' to apply them. August 10, 2017 - 01:22:59 Django version 1.10.7, using settings 'HelloWorld.settings' Starting development server at http://119.23.175.75:8000/ Quit the server with CONTROL-C. Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS. [10/Aug/2017 01:23:15] "GET / HTTP/1.1" 400 60326 Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS. [10/Aug/2017 01:23:16] "GET /favicon.ico HTTP/1.1" 400 60408 ^C[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py migrate解决办法:
python manage.py migrate又报错:
[root@iZwz9j0rhuuld23m4jpvjiZ HelloWorld]# python manage.py runserver 119.23.175.75:8000 Performing system checks... System check identified no issues (0 silenced). August 10, 2017 - 01:24:13 Django version 1.10.7, using settings 'HelloWorld.settings' Starting development server at http://119.23.175.75:8000/ Quit the server with CONTROL-C. Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS. [10/Aug/2017 01:24:29] "GET / HTTP/1.1" 400 60311 Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS. [10/Aug/2017 01:24:29] "GET /favicon.ico HTTP/1.1" 400 60393 Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS. [10/Aug/2017 01:24:32] "GET / HTTP/1.1" 400 60446 Invalid HTTP_HOST header: '119.23.175.75:8000'. You may need to add u'119.23.175.75' to ALLOWED_HOSTS.解决办法:
settings.py ALLOWED_HOSTS = [] 修改为: ALLOWED_HOSTS = ['*']另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
新闻名称:Django部署-创新互联
当前URL:http://ybzwz.com/article/dghdgc.html