Answer the question
In order to leave comments, you need to log in
How to do infinite link deepening in Django?
A friend has a website where you can create a directory in the admin panel, and there is another directory in it, and there is another in it, and so on.
I came up with this thing: a model, with reference to itself. You can add an entry, then create another entry and link it to the first one.
Let's say I want to add an Animals entry, then a Mammals entry and link it to the first one, then add a Feline entry and link it to Mammals, and the last entry is Tiger, which will be linked to the Feline family. And the trick is that such recesses can be done endlessly.
Question. How can I make such a tree in urls.py so that it looks the same in the address bar as it does on a friend's site?:
http://localhost/Jivotnie/Mlekopitaushie/Semeistvo_Koshachih/Tigr/и так далее
Answer the question
In order to leave comments, you need to log in
You definitely won’t be able to do it endlessly, because.
The maximum length of a URL in its address bar is 2048 characters
url(r"^(?P<MyStrangeVariable>\d+)/$", MyStrangeCode.as_view()),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question