'URL.py includes no longer works together, only one or the other
My base urls.py in the root folder is laid out as such:
from django.contrib import admin
from django.urls import path, re_path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('apps.main.urls')),
path('', include('apps.login_app.urls')), ]
But this is only seeing the apps.main.urls urls.py in its own app. It will not see the apps.login_app.urls.
Though when commenting out apps.main.urls, the apps.login_app.urls start working.
Any help on this would be greatly appreciated.
Solution 1:[1]
You need to create a prefix like
urlpatterns = [
path('admin/', admin.site.urls),
path('main/', include('apps.main.urls')),
path('logins', include('apps.login_app.urls')), ]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mohamed ElKalioby |
