How to solve “Page not found (404)” error in Django?

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 site at http://127.0.0.1:8000/admin/ and your food posts at http://127.0.0.1:8000/foodPosts/.

To add a url pattern for the homepage, uncomment the following entry in your urls.py, and replace homefood.views.home with the path to the view you want to use.

url(r'^$', 'homefood.views.home', name="home"),

Leave a Comment