Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/index |
Using the URLconf defined in protwo.urls
, Django tried these URL patterns, in this order:
The current path, index
, didn't match any of these.
You're seeing this error because you have DEBUG = True
in your Django settings file. Change that to False
, and Django will display a standard 404 page.
##The code I written in my project are;:-
--------------------------------------------------------------------
<urls.py-first_project>
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('first_app/', include('first_app.urls'))
]
----------------------------------------------------------------------
-----------------------------------------------------------------------
<urls.py-first_app>
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('index/', views.index, name="index"),
]
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4af88190-6f81-409a-aafa-0b6cfda63d70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,
The code is absolute ,the thing is that u may have edited the code more than once and didn’t save it or some thing happened the url path is checking in protwos.urls it should check in first_app.urls.....so delete the app and create app again with same code u will see the result
Sent from Mail for Windows 10
I just did the same..see the result
On Saturday, March 23, 2019 at 9:50:25 PM UTC+5:30, egbosi Kelechi wrote:
Great. You are on the right track, only that the Url path you typed in the address bar triggered the error.
You should use /first_app/index/
Reason:the index url path is located in the first_app. Urls file.
On Sat, Mar 23, 2019, 5:07 PM The Aryas <arya2...@gmail.com wrote:
Hey Guys, I am facing problem on django url mapping, I did exactly what my couse said and copied the code text exactly,but it throws the error:-
Page not found (404)
Request Method:
GET
Request URL:
Using the URLconf defined in
protwo.urls
, Django tried these URL patterns, in this order:
1. admin/
2. [name='index']
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c476cb22-92b0-44da-ac4e-f2ab3eb948cc%40googlegroups.com.
urlpatterns = [
path('admin/', admin.site.urls),
path('first_app/', include('first_app.urls')),
]