Solution 1:

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'),

Solution 2:

Basically the answer to this to add a entry in the project urls.py file as blank example:

path('', include('MYAPP.urls')),

and in the app urls.py you add this

url('MYAPP', views.index),

make sure in the settings.py you include your app also make sure in the app urls.py you import your views

Solution 3:

I had this error too and the solution was to change double quotes to single quotes for the name= parameter in the urls.py file of the concerned app!

path('register', views.register, name='register')