[Answer]-Throwing back a URL in Django

1👍

(Edited since the entire premise of the question changed)

If you need to catch app_name/model_name URLs, my suggestion is that you generate your URL patterns dynamically. There’s no reason you couldn’t iterate through INSTALLED_APPS, get all available classes that inherit from models.Model, and create URL patterns in a list accordingly. Then you can feed that into the patterns function at the end.

Trying to inform the URL dispatcher that it was somehow “wrong” is misguided, as I’ve already explained, and you’re solving the wrong problem. Instead, you should focus on configuring the URL patterns how you actually need them.

Leave a comment