2 Replies - 340 Views - Last Post: 12 February 2016 - 10:24 AM Rate Topic: -----

#1 alanford  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-February 16

server running but nothing in web browser

Posted 12 February 2016 - 03:14 AM

Hi,

I have python server running in terminal but I don't get anything in my web browser, beside it, below is written django 1.8.3 but I made upgrade to django 1.9.2, my app is in srv and root folders, in srv I started with python3 and in root folder with python2.7:

(env)[email protected]:/srv/mercury# python3 ./manage.py runserver 0.0.0.0:8080
Performing system checks...
System check identified no issues (0 silenced).
February 12, 2016 - 08:38:18
Django version 1.8.3, using settings 'mercury.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.


settings.py:

DEBUG = False
#ALLOWED_HOSTS = ['*',]
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'myip', 'mydomain',]


I tried also development, without deployment (debug true and allowed hosts *), in my root folder, but it is the same problem, I don't get anything in firefox:

(env)[email protected]:~/mercury# python ./manage.py runserver 0.0.0.0:8080
Performing system checks...
System check identified no issues (0 silenced).
February 12, 2016 - 10:05:19
Django version 1.8.3, using settings 'mercury.settings'
Starting development server at http://0.0.0.0:8080/
Quit the server with CONTROL-C.



I tried to make deployment, for my app in SRV folder, in my mercury.conf in apache I added next things:

<VirtualHost *:80>
............
<Directory /srv/mercury/mercury>
                Options +ExecCGI
                DirectoryIndex index.py
        </Directory>
        AddHandler cgi-script .py
AddHandler mod_python .py

<Directory /srv/mercury/mercury>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

Alias /static /srv/mercury/static
    <Directory /srv/mercury/static>
        Require all granted
    </Directory>

WSGIDaemonProcess mercury python-path=/srv/mercury:/srv/env/lib/python3.4/site-packages
    WSGIProcessGroup mercury
    WSGIScriptAlias / /srv/mercury/mercury/wsgi.py

</VirtualHost>


I don't know where is my mistake, maybe apache configuration is not good? I did also "sudo chown :www-data /srv/mercury". but I have the same problem even when I try my python/django app in development mode. I tried also python and python3 ./manage....... but it was not solution, when I type my domain or IP and port in firefox, it is turning on & problem loading page.

Is This A Good Question/Topic? 0
  • +

Replies To: server running but nothing in web browser

#2 ndc85430  Icon User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 720
  • View blog
  • Posts: 2,909
  • Joined: 13-June 14

Re: server running but nothing in web browser

Posted 12 February 2016 - 05:32 AM

View Postalanford, on 12 February 2016 - 10:14 AM, said:

I have python server running in terminal but I don't get anything in my web browser


It isn't clear to me what you mean by "I don't get anything in my web browser". I don't have any experience with Django, but some general things are worth checking, like

1. Are you able to connect to the server from your browser?
2. If so, what happens when you make a request to the root path (i.e. "/"), or some other path you know is handled by your application? Does it succeed or not? You've said something about "problem loading page" later on in your post. What exactly do you mean by that?
Was This Post Helpful? 0
  • +
  • -

#3 alanford  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-February 16

Re: server running but nothing in web browser

Posted 12 February 2016 - 10:24 AM

View Postndc85430, on 12 February 2016 - 05:32 AM, said:

It isn't clear to me what you mean by "I don't get anything in my web browser". I don't have any experience with Django, but some general things are worth checking, like

1. Are you able to connect to the server from your browser?
2. If so, what happens when you make a request to the root path (i.e. "/"), or some other path you know is handled by your application? Does it succeed or not? You've said something about "problem loading page" later on in your post. What exactly do you mean by that?


in firefox, it is loading, loading, and I get result of error: problem loading page. it means I could not reach server.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1