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 <[email protected] 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: http://127.0.0.1:8000/index > > Using the URLconf defined in protwo.urls, Django tried these URL > patterns, in this order: > > 1. admin/ > 2. [name='index'] > > 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"), > > ] > > ------------------------------------------------------------------------- > -------------------------------------------------------------------------- > <views.py> > > from django.shortcuts import render > from django.http import HttpResponse > > # Create your views here. > def index(request): > return HttpResponse("Hello World") > > ---------------------------------------------------------------------------- > > ---------------------------------------------------------------------------- > > <settings.py> > > INSTALLED_APPS = [ > 'django.contrib.admin', > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.messages', > 'django.contrib.staticfiles', > 'first_app' > ] > > > ------------------------------------------------------------------------------- > > I dont know what to do , I could not find the error plz assist me, I am a > begginer to this cousre, > Thank You!! > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 > <https://groups.google.com/d/msgid/django-users/4af88190-6f81-409a-aafa-0b6cfda63d70%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CA%2BURHMTnx8zn_MCTKhigw3uYJgpyR9XencKwnCoRkCJjYJdp9w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

