简体   繁体   English

无法在OpenShift中启动服务器

[英]Can't start server in openshift

I have deployed django with quick start . 我已经开始快速部署django了

When I try to start django-server with python manage.py runserver in SSH-Terminal, I get following error: 当我尝试在SSH终端中使用python manage.py runserver启动django-server时,出现以下错误:

Performing system checks... 
System check identified no issues (0 silenced). 
October 04, 2015 - 20:56:45 
Django version 1.8.2, using settings 'mysite.settings' 
Starting development server at http://127.0.0.1:8000/ 
Quit the server with CTRL-BREAK. 
Error: You don't have permission to access that port.

How can I start the django-server successfully? 如何成功启动django服务器?

You seem to have a few things that you are doing that are probably causing the issues that you are encountering. 您似乎正在执行的某些操作可能会导致您遇到的问题。

  1. You should not use the runserver command to start the server in a production environment, that is only to run a local server for development purposes. 您不应使用runserver命令在生产环境中启动服务器,即仅出于开发目的而运行本地服务器。

  2. You can't start a server on port 8000 on openshift, you need to start it on port 8080 , see: https://developers.openshift.com/en/managing-port-binding-routing.html 您无法在openshift的8000端口上启动服务器,而需要在8080端口上启动服务器,请参阅: https : //developers.openshift.com/en/managing-port-binding-routing.html

  3. The current version of the django quickstart ( #464680f on Sep 9) is not working properly, you can use this repo for the moment: https://github.com/jsvgoncalves/django-openshift django quickstart的当前版本(9月9日#464680f )无法正常工作,您可以暂时使用此存储库: https : //github.com/jsvgoncalves/django-openshift

    Edit: The bug reported in 3. was fixed here: https://bugzilla.redhat.com/show_bug.cgi?id=1308722 编辑:在3中报告的错误已在以下位置修复: https : //bugzilla.redhat.com/show_bug.cgi?id=1308722

Also, as per the README.md of that repo, you should set the $OPENSHIFT_PYTHON_WSGI_APPLICATION environment variable to the path of wsgi.py . 此外,由于每README.md是回购的,你应该设置$OPENSHIFT_PYTHON_WSGI_APPLICATION环境变量的路径wsgi.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM