Y
You're doing the same job twice when in the original urls file, it's the same way in another urls file.Fix your code to the following:# корневой urls.py
from django.contrib import admin
from django.urls import path, include
from main.views import index, me, news
urlpatterns = [
path('admin/', admin.site.urls),
path('', index, name='about'),
path('me/', me, name='profile'),
path('news/', news, name='feed')
]
In this case, you won't need a urls file in the annex. The same can be done by another:# корневой urls.py
from django.contrib import admin
from django.urls import path, include
from main.views import index, me, news
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('main.urls')),
]
# urls.py приложения
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='about'),
path('me/', views.me, name='profile'),
path('news/', views.news, name='feed'),
]
It'll be better. Later, if you expand the project and set up new applications, you can just connect the urls of the applications in the url root controller, give a namespace and other parameters while keeping your code in the loop.In your code Django passes the code in the root of the urls.py and, three times, you connect the same urls application file, every time you replace the path to the last discovered. It's like taking the variable meaning and then changing it twice. The last line is the way. news free /therefore references are made newsme♪Recognize how Django handles url by reading official documentation https://docs.djangoproject.com/en/3.1/topics/http/urls/