Answer the question
In order to leave comments, you need to log in
Django It seems to be looking for a template in the wrong place or a function is written incorrectly, what should I do?
In general, I tried to create my first site on Django (Django version 3.0.5 Python version 3.8.2). The course was quite outdated but any minor problems were quickly resolved.
Folder structure:
mysite\
mainApp
\
__pycache__
migrations\
__pycache__
mysite\
__pycache__
tamplates
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path(r'admin/', admin.site.urls),
<b>path(r'^$', include('mainApp.urls')),</b>
]
from django.urls import path, include
from . import views
urlpatterns = [
path('^$', views.index, name='index')
]
from django.shortcuts import render
def index(request):
return render(request, 'mainApp/homePage.html')
Answer the question
In order to leave comments, you need to log in
Check how you connected the templates. Or leave the quotes not empty and insert / into them. Better yet, update django to version 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question