Answer the question
In order to leave comments, you need to log in
Page not found?
I have urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.news, name='news'),
path('gdz7', views.gdz7, name='gdz7'),
path('chat', views.chat, name='chat')
]
from django.shortcuts import render
from .models import Post, Gdz7
def news(request):
posts = Post.objects.order_by('-id')
return render(request, 'news/index.html', {'title': 'Главная страница сайта', 'posts' : posts})
def gdz7(request):
posts = Gdz7.objects.order_by('-id')
return render(request, 'gdz7/index.html', {'title': 'Главная страница сайта', 'posts' : posts})
def chat(request):
return render(request, 'chat/index.html')
Using the URLconf defined in HelloDjango.urls, Django tried these URL patterns, in this order:
admin/
[name='news']
gdz7 [name='gdz7']
The current path, chat, didn't match any of these.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question