Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page not found (404) - Problem
#1
I started a project Learning_log. All going well till I started making pages.

It was opening alright in django.
------------------
In urls.py (following changes: include in 2nd line and path in 5th. line)

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

urlpatterns = [
path('admin/', admin.site.urls),
path(' ', include('learning_logs.urls')),
]
---------------
IN learning_log folder, new urls.py file:

"""Defines URL patterns for learning_logs."""

from django.urls import path

from . import views

app_name = 'learning_logs'
urlpatterns = [
# Home Page
path(' ', views.index, name='index'),
]
---------------
In views.py :

from django.shortcuts import render

# Create your views here.
def index(request):
	"""The home page for Learning Log."""
	return render(request, 'learning_logs/index.html')
---------------
Then in project folder learning_log, made new folder inside learning_logs called templates. Inside templates a learning_logs folder and finally a index.html page with following:

Output:
<p>Learning Log</p> <p> Learning Log helps you to keep track of your learning,for any topic you're learning about. </p>
---------------

It shows Page not found 404 error.....What to do ???
Anyone can advice...??
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,578 Mar-19-2020, 06:13 PM
Last Post: apollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020