0

I have created Django API with three apps (users, task, house) with with help of routers show data in ViewSets. Some of these routers have to register multiple ViewSets.

When testing endpoints both locally and on remote server (Heroku gunicorn) they are working. As app should be deployed in DEBUG=False mode, when I changed that in settings.py I came across a problem.!

I changed DEBUG=False as expected to be on a live server. When I entred domain name generated by Heroku, I got message ::::: Not Found – The requested resource was not found on this server.

I tried to enter endpoints manually (domain_name/endpoint) and it worked.

Obviously I do not have anything under path(' ', include(...............)) as there is no priority for any of the three apps.

I you have any idea/suggesting on how to get listed URLS admin/, api/ as on local server please let me know. Many thanks in advance.

Sanna
  • 1
  • 1

1 Answers1

0

If you don' t associate a view with the path '', the server will always return a Page Not Found error as with other unregistered paths with DEBUG=False. You can simply create a custom template (written in html) that lists your urls and then use a TemplateView to show it in your index. Otherwise you could generate the schema/documentation of your API and shows it at the path '', checks the documentation for this option

Alain Bianchini
  • 3,883
  • 1
  • 7
  • 27