Django: can I use the views used by the admin panel?

Just learning django here by going through their website tutorial.

When they take you through the admin panel, is that how wow, all I have to do is define a model and django will give me a cool web page like this?

But this does not seem to be the case - it seems that all these cool automatic functions are only inside the admin panel. It seems that if you want to have a cool add / change form, for example, a form that looks and acts like the one in the admin panel, you will have to do all the layout and interesting functions manually.

Am I really wrong? Is there a way to do something that looks and works just like the admin panel "edit entry", but on its own URL?

+4
source share
1 answer

You are right, but I think your expectations may be wrong.

Django's automatic admin site is one of the things that makes it very powerful. For example, if you are building a large site, you usually have to spend a lot of time creating an admin site, I mean A LOT! This way, Django automatically provides a useful admin site and does a good job, which is great.

, , Django " " , . , ModelForms, ClassBasesView .. , , . , .

, , , .

( , )

+2

Source: https://habr.com/ru/post/1626914/


All Articles