Unable to display events list and event details on Django website despite creating views, templates, and database entries.

Hi everyone,

I’m working on my first Django project- Event Management System and facing an issue. I have uploaded my project on GitHub: GitHub - mir-ishtiaq/EventHubApp

The issue is that after creating views and templates for the events page, I expected to see the webpage at http:// 127.0.0.1:8000/events/, but I’m facing 404 error. Additionally, when I manually try to visit http:// 127.0.0.1:8000/events/, I also get a 404 error. in http:// 127.0.0.1:8000 I’m still seeing the default Django page which says “You’re seeing this page because DEBUG=TRUE is in your settings file”. I have already created data in the database through the admin panel, and I’m not sure what could be causing this issue.

I would greatly appreciate any insights or suggestions on how to resolve this issue. Thank you!

You have not included your app urls in root urls i.e EventHubApp > urls to EventHub > urls.
Simple include EventHubApp urls like this to your EventHub urls.

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", include("EventHubApp.urls")),
]

also in your EventHubApp urls you can remove admin url and import and can use it like below.

from django.urls import path
from . import views

urlpatterns = [
    path('events/', views.event_list, name='event_list'),
    path('events/<int:event_id>/', views.event_detail, name='event_detail'),
]