question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sometimes Django throws 404 error

See original GitHub issue

After upgrading to the latest I got strange issue “static files not loading correctly”. I have whitenoise setup correctly…

pip freeze

asgi-redis==0.10.0
asgiref==0.11.2
autobahn==0.13.1
channels==0.11.0
daphne==0.10.3
Django==1.9.5
django-reversion==1.10.1
django-reversion-compare==0.6.1
djangorestframework==3.3.3
gitdb==0.6.4
GitPython==1.0.2
gunicorn==19.4.5
msgpack-python==0.4.7
psycopg2==2.6.1
pytz==2016.3
redis==2.10.5
requests==2.9.1
six==1.10.0
smmap==0.9.0
Twisted==16.1.1
txaio==2.3.1
whitenoise==3.0
zope.interface==4.1.3

Output of runserver…

[2016/04/12 17:54:57] HTTP GET /static/css/bootstrap.min.css 304 [0.05, 127.0.0.1:46579]
[2016/04/12 17:54:58] HTTP GET /static/css/bootstrap.min.css 304 [0.04, 127.0.0.1:46579]
[2016/04/12 17:54:58] HTTP GET /static/css/bootstrap.min.css 304 [0.03, 127.0.0.1:46579]
[2016/04/12 17:54:58] HTTP GET /static/css/bootstrap.min.css 304 [0.03, 127.0.0.1:46579]
[2016/04/12 17:54:59] HTTP GET /static/css/bootstrap.min.css 404 [0.03, 127.0.0.1:46579]
[2016/04/12 17:54:59] HTTP GET /static/css/bootstrap.min.css 200 [0.02, 127.0.0.1:46579]
[2016/04/12 17:54:59] HTTP GET /static/css/bootstrap.min.css 304 [0.02, 127.0.0.1:46579]
[2016/04/12 17:55:00] HTTP GET /static/css/bootstrap.min.css 304 [0.01, 127.0.0.1:46579]
[2016/04/12 17:55:00] HTTP GET /static/css/bootstrap.min.css 304 [0.02, 127.0.0.1:46579]
[2016/04/12 17:55:00] HTTP GET /static/css/bootstrap.min.css 404 [0.01, 127.0.0.1:46579]
[2016/04/12 17:55:01] HTTP GET /static/css/bootstrap.min.css 200 [0.03, 127.0.0.1:46579]
[2016/04/12 17:55:01] HTTP GET /static/css/bootstrap.min.css 304 [0.03, 127.0.0.1:46579]
[2016/04/12 17:55:01] HTTP GET /static/css/bootstrap.min.css 304 [0.04, 127.0.0.1:46579]
[2016/04/12 17:55:01] HTTP GET /static/css/bootstrap.min.css 304 [0.01, 127.0.0.1:46579]
[2016/04/12 17:55:02] HTTP GET /static/css/bootstrap.min.css 404 [0.04, 127.0.0.1:46579]
[2016/04/12 17:55:02] HTTP GET /static/css/bootstrap.min.css 200 [0.01, 127.0.0.1:46579]
[2016/04/12 17:55:02] HTTP GET /static/css/bootstrap.min.css 304 [0.02, 127.0.0.1:46579]
[2016/04/12 17:55:02] HTTP GET /static/css/bootstrap.min.css 304 [0.04, 127.0.0.1:46579]
[2016/04/12 17:55:03] HTTP GET /static/css/bootstrap.min.css 304 [0.04, 127.0.0.1:46579]
[2016/04/12 17:55:03] HTTP GET /static/css/bootstrap.min.css 404 [0.03, 127.0.0.1:46579]
[2016/04/12 17:55:03] HTTP GET /static/css/bootstrap.min.css 200 [0.03, 127.0.0.1:46579]
[2016/04/12 17:55:03] HTTP GET /static/css/bootstrap.min.css 304 [0.03, 127.0.0.1:46579]
[2016/04/12 17:55:03] HTTP GET /static/css/bootstrap.min.css 304 [0.04, 127.0.0.1:46579]
[2016/04/12 17:55:04] HTTP GET /static/css/bootstrap.min.css 304 [0.01, 127.0.0.1:46579]
[2016/04/12 17:55:04] HTTP GET /static/css/bootstrap.min.css 404 [0.02, 127.0.0.1:46579]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rajasimoncommented, Apr 13, 2016

When using python manage.py runserver --noasgi command the above error not producing.

1reaction
onegreyonewhitecommented, May 17, 2016

I started manage.py runworker too. But this error always appears.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django 404 error-page not found
You are getting the 404 because you haven't defined a url pattern for http://127.0.0.1:8000/ yet. You should be able to view the admin...
Read more >
Django - Creating a 404 Error Page
The 404 error is raised when the URL called upon doesn't exist or has not been defined yet. This is commonly referred to...
Read more >
How to manage error reporting
If those conditions are met, Django will email the users listed in the MANAGERS setting whenever your code raises a 404 and the...
Read more >
Raising a 404 error from a Class Based View in Django
Sometimes you may wish to raise a 404 in the middle of a class based view. Perhaps you determine in the middle of...
Read more >
Showing 404 errors In Django
As there is no such category in the database the URL http://127.0.0.1:8000/blog/category/cat_not_exists/ is completely invalid. In production (i.e when DEBUG= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found