So if you want to request you page, it will look like this,
localhost:hello/hello.


At the app level of the urls, you can leave that path empty like this.....
path(" ", views.delih......, name = "deliii....")


Then you can request you web page as localhost:/hello

On Sat, Apr 15, 2023, 12:38 AM Lawal Tobiloba Samuel <
oluwasheun9...@gmail.com> wrote:

> What I notice is that wgen you are creating ur urls at the project level,
> you used "hello/" and you include the the app level urls.
>
>
> If you want to request the route from the browser, you are suppose to use
> localhost:8000/hello, not localhost:home.
>
>
>
> Remember: you did not create a route for "home"
>
> On Fri, Apr 14, 2023, 11:07 PM lalit upadhyay <upadhyaylali...@gmail.com>
> wrote:
>
>> *I have copied my code here. Plz fix this error:*
>>
>>
>> view.py
>> from django.http import HttpResponse
>>
>>
>> def hello_delhi_capitals(request):
>> return HttpResponse('Hello Delhi Capitals!')
>>
>>
>>
>> myproject/urls.py
>>
>> from django.contrib import admin
>> from django.urls import path, include
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('hello/', include('myapp.urls')),
>> ]
>>
>>
>>
>> myapp/urls.py
>>
>>
>>
>> from django.urls import path
>> from .views import hello_delhi_capitals
>>
>> urlpatterns = [
>> path('hello/', hello_delhi_capitals, name='hello_delhi_capitals'),
>> ]
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b157258f-6697-4bd7-81c7-48e425b4a1edn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAscozVzrDMuUUu80o53WXVYUUTEU-NApazqHxyZaxQeewQ01A%40mail.gmail.com.

Reply via email to