简体   繁体   中英

Can't start server in openshift

I have deployed django with quick start .

When I try to start django-server with python manage.py runserver in SSH-Terminal, I get following error:

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?

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.

  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

  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

    Edit: The bug reported in 3. was fixed here: 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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