html home file is not opening while running under django env......

28 views
Skip to first unread message

হজমুলা খান

unread,
Oct 31, 2019, 7:45:23 AM10/31/19
to Django users
i am novice and following django for beginners ebook. while i am running the program  base.html and about.html are working properly but when i click on the home link, it shows:

Page not found (404)

Request Method:GET
Request URL:http://localhost:8000/home

Using the URLconf defined in pages_project.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. [name='home']
  3. about/ [name='about']

The current path, home, didn't match any of these.


i have installed Jinja2 and if i open base.html without running django server, it works well but under django server it's not working. what should i do?

Kasper Laudrup

unread,
Oct 31, 2019, 8:22:48 AM10/31/19
to django...@googlegroups.com
Hi হজমুলা খান,

On 31/10/2019 11.22, হজমুলা খান wrote:
> i am novice and following django for beginners ebook. while i am running
> the program  base.html and about.html are working properly but when i
> click on the home link, it shows:
>
>
> Page not found (404)
>
> Request Method: GET
> Request URL: http://localhost:8000/home
>
> Using the URLconf defined in |pages_project.urls|, Django tried these
> URL patterns, in this order:
>
> 1. admin/
> 2. [name='home']
> 3. about/ [name='about']
>
> The current path, |home|, didn't match any of these.
>
>
> i have installed Jinja2 and if i open base.html without running django
> server, it works well but under django server it's not working. what
> should i do?
>

You need to add 'home' to your urls.py inside your pages_project
directory. Read more here:

https://docs.djangoproject.com/en/2.2/topics/http/urls/

Kind regards,

Kasper Laudrup

Shubham Badaya

unread,
Oct 31, 2019, 8:57:14 AM10/31/19
to Django users
I am not knowledge form digonal

হজমুলা খান

unread,
Oct 31, 2019, 6:27:27 PM10/31/19
to Django users
thanx for your reply. i have edited pages_project/urls.py as follows: urlpatterns = [ path('admin/', admin.site.urls), path('home/', include('pages.urls')), in this case home page is working but base.html and about.html is not showing . if i add path('about/', include('pages.urls')), then both home.html and about.html is showing but the url becomes localhost:8000/home/aboutlocalhost:8000/about is not working. i put home.html in new folder pages and the order your talked about but they have no effect because i kept the files in both sides. plz share any new idea  

Bruckner de Villiers

unread,
Nov 1, 2019, 12:24:49 AM11/1/19
to django...@googlegroups.com
Did you import include?

Bruckner
0836251086

On 01 Nov 2019, at 00:29, হজমুলা খান <needle...@gmail.com> wrote:


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/83c8c6ed-0a81-47a3-9e51-bdf8458fb2bb%40googlegroups.com.

হজমুলা খান

unread,
Nov 1, 2019, 6:37:06 PM11/1/19
to Django users
ofcourse yes otherwise it will show error
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Nijo Joseph

unread,
Nov 2, 2019, 9:20:46 AM11/2/19
to django...@googlegroups.com
Just type localhost:8000/ that's all. No need home as you didn't make a route home it's blank and name is home, not route.

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d98395a1-a31f-4186-8833-c02b3881314a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages