Forums

Always getting 404 error when refreshing my web page

I am getting the below error suddenly, it was accepting request before and getting proper error logs "GET / HTTP/1.1" 404 100 "-" "python-requests/2.2.0 CPython/2.7.5+ Linux/3.11.0-26-generic" what is the problem.

This is my wsgi.py file

activate_this = '/home/sivakumarar/.virtualenvs/django17/bin/activate_this.py' execfile(activate_this, dict(file=activate_this))

import os import sys

Add the path to sys.path

path = '/home/sivakumarar/django_proj_dep/siva_blog/myblog' if path not in sys.path: sys.path.append(path)

os.chdir(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

from django.core.wsgi import get_wsgi_application application = get_wsgi_application()

, i am also putting my access.log error here again - [12/Oct/2014:12:53:38 +0000] "GET / HTTP/1.1" 404 100 "-" "python-requests/2.2.0 CPython/2.7.5+ Linux/3.11.0-26-generic also my error.log is not getting loaded, i guess because access is only not happening ... can you please let me know where to look for the error ?

Hi there -- this is happening because your Django app doesn't have the URL "/" bound to any view. If you add one, it should work fine.

Hi, Thanks for the reply,

I changed my urls.py as suggested by you i am not getting 404 error now,i am getting a different error now

[13/Oct/2014:09:19:29 +0000] "GET / HTTP/1.1" 500 38 "-" "python-requests/2.2.0 CPython/2.7.5+ Linux/3.11.0-26-generic"

but the error.log is empty, where to look for the issue?

one more update, I am getting the below error in server.log

2014-10-13 09:36:03 Mon Oct 13 09:36:03 2014 - received message 0 from emperor 2014-10-13 09:36:03 SIGINT/SIGQUIT received...killing workers... 2014-10-13 09:36:04 worker 1 buried after 1 seconds 2014-10-13 09:36:04 goodbye to uWSGI. 2014-10-13 09:36:04 chdir(): No such file or directory [core/uwsgi.c line 1541] 2014-10-13 09:36:04 VACUUM: unix socket /var/sockets/sivakumarar.pythonanywhere.com/socket removed.

one more update, I found issue in my urls.py file and views.py file if initial data is not present at the beginning fixed it, still there is error

i am getting the below from access.log and server.log and again i don't see error.log and also the web page is not yet loaded

1) access.log

[13/Oct/2014:10:07:13 +0000] "GET / HTTP/1.1" 200 1569 "-" "python-requests/2.2.0 CPython/2.7.5+ Linux/3.11.0-26-generic"

2) server.log 2014-10-13 10:07:03 Mon Oct 13 10:07:03 2014 - received message 1 from emperor

2014-10-13 10:07:03 ...gracefully killing workers...

2014-10-13 10:07:03 Gracefully killing worker 1 (pid: 28618)...

2014-10-13 10:07:06 worker 1 buried after 1 seconds

2014-10-13 10:07:06 uWSGI: GAME OVER (insert coin)

2014-10-13 10:07:06 chdir(): No such file or directory [core/uwsgi.c line 1541]

2014-10-13 10:07:06 VACUUM: unix socket /var/sockets/sivakumarar.pythonanywhere.com/socket removed.

2014-10-13 10:07:13 *** Starting uWSGI 2.0.5.1 (64bit) on [Mon Oct 13 10:07:07 2014] ***

2014-10-13 10:07:13 compiled with version: 4.8.1 on 16 September 2014 17:44:51

Can you please tell me what is the meaning of the server log and why it is coming.

update:

I could able to see my webpage now, i was accessing like www.username.pythonanywhere.com and was getting the previously mentioned error, but when i used username.pythonanywhere.com alone it was successfull.

Is this any thing to do with my configurations ?

Your web app is always at username.pythonanywhere.com, not www.username.pythonanywhere.com -- the latter hostname will go to PythonAnywhere, but there's no web app set up to run there.

The messages in the server log are normal, that's just what you'll see as the app is stopped and started.