2
I have a file urls.py in the project with my API routes, I am importing the routes and concatenating into a variable called api_urls, to then include the variable with the routes, but when doing this, only the router_user routes appear in the Root API page, because, in order were the first that I added in api_urls. How do I list all the routes on the Root API page?
Urls of the Project
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from usuarios.urls import router_usuario
from avisos.urls import router_avisos
from boletos.urls import router_boletos
from condominio.urls import router_condominio
from endereco.urls import router_endereco
from registros.urls import router_registros
from reservas.urls import router_reservas
from taxas.urls import router_taxas
api_urls = router_usuario.urls + router_avisos.urls +
router_boletos.urls + router_condominio.urls \
+ router_endereco.urls + router_registros.urls + router_reservas.urls
+ router_taxas.urls
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('rest_framework.urls')),
path('', include(api_urls)),
]
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
Unfortunately, it did not work. An error has occurred, please follow stacktrace: https://pastebin.com/XwEPbvfL
– Juliana Marques
Pastebin is blocked for me to see here, if you can put in another location: dontpad
– Douglas Teles
there you are: http://dontpad.com/XwEPbvfL
– Juliana Marques
How were the urls coming the way they were before? Print api_urls and send it to me on the same site please
– Douglas Teles
These are the urls I’m importing to the.py urls of the project: http://dontpad.com/urls
– Juliana Marques
Previously, urls were being added like this: http://dontpad.com/api_urls, as shown in the question, however, only the first url I add in api_urls is shown in Root Api
– Juliana Marques