我刚刚开始使用Django.所以我创建了一个django项目并运行命令
python3 manage.py runserver 0.0.0.0:8000
Run Code Online (Sandbox Code Playgroud)
我收到以下错误消息,而不是获得预期的django主页,
DisallowedHost at /
Invalid HTTP_HOST header: '0.0.0.0:8000'. You may need to add '0.0.0.0' to ALLOWED_HOSTS.
Request Method: GET
Request URL: http://0.0.0.0:8000/
Django Version: 1.10.5
Exception Type: DisallowedHost
Exception Value:
Invalid HTTP_HOST header: '0.0.0.0:8000'. You may need to add '0.0.0.0' to ALLOWED_HOSTS.
Exception Location: /usr/local/lib/python3.5/site-packages/django/http/request.py in get_host, line 113
Python Executable: /usr/local/opt/python3/bin/python3.5
Python Version: 3.5.2
Run Code Online (Sandbox Code Playgroud)
我还没有抓住django的表面,所以会对如何解决这个问题有所帮助吗?
这是我的 React 应用程序的启动脚本。
"scripts": {
"prestart": "babel-node tools/startMessage.js",
"start": "npm-run-all --parallel test:watch open:src lint:watch",
"open:src": "babel-node tools/srcServer.js",
"lint": "node_modules/.bin/esw webpack.config.* src tools",
"lint:watch": "npm run lint -- --watch",
"test": "mocha --reporter progress tools/testSetup.js \"src/**/*.test.js\"",
"test:watch": "npm run test -- --watch",
"clean-dist": "npm run remove-dist && mkdir dist",
"remove-dist": "node_modules/.bin/rimraf ./dist",
"build:html": "babel-node tools/buildHtml.js",
"prebuild": "npm-run-all clean-dist test lint build:html",
"build": "babel-node tools/build.js",
"postbuild": "babel-node tools/distServer.js"
},
Run Code Online (Sandbox Code Playgroud)
当我运行 npm start 时,我得到一长串错误。
npm ERR! System Linux 3.10.0-327.36.3.el7.20161025.20.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" …Run Code Online (Sandbox Code Playgroud) 我试图找到由x轴与x轴连接点的线所形成的角度.所以实际上我试图找到普通的旧棕褐色逆.这是我在Python 3中使用的代码
angle_with_x_axis = math.atan(y_from_centre / x_from_centre)
Run Code Online (Sandbox Code Playgroud)
我喂的point(1,1)是y_from_centre和x_from_centre我得到
0.7853981633974483
Run Code Online (Sandbox Code Playgroud)
我的预期结果是45,但很自然.我在这做错了什么?