To Use or Not to Use the admin backend

116 views
Skip to first unread message

Frankline

unread,
Sep 3, 2012, 11:38:03 AM9/3/12
to django...@googlegroups.com
Hi,

I'm creating a site in Python/Django and feel that the admin backend, as good as it is, may not be a one-fit-for-all situations.

My question is this:

Have any of you ever had a need to have a custom admin backend?

In what example situations would one create his/her own admin backend rather than using the default admin panel that ships with Django?

What are the disadvantages of rewriting your own backend?

Regards,
Frank

Mario Gudelj

unread,
Sep 3, 2012, 5:43:41 PM9/3/12
to django...@googlegroups.com

You can certainly write your own. I wrote one for a saas solution i worked on since it was quite custom and i didn't need much of the functionality admin offered. But admin will help you with all that CRUD you normally have to create yourself. So, it really depends what your requirement is.

M

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Lachlan Musicman

unread,
Sep 3, 2012, 5:48:32 PM9/3/12
to django...@googlegroups.com
On Tue, Sep 4, 2012 at 3:38 AM, Frankline <frao...@gmail.com> wrote:
> Hi,
>
> I'm creating a site in Python/Django and feel that the admin backend, as
> good as it is, may not be a one-fit-for-all situations.
>
> My question is this:
>
> Have any of you ever had a need to have a custom admin backend?

Only just yesterday...

> In what example situations would one create his/her own admin backend rather
> than using the default admin panel that ships with Django?

I think it's only recently that the documentation actually reflected
the idea that the Django Admin should be used in production. I did a
very simple site w Django 2 years ago and was mocked in IRC for using
the built in django admin: "you are not doing it right". I'm pretty
thick skinned and ignored the comment, but I think it was usual to
write what you needed rather than let the client use the provided back
end.

Anyway, to the question. Once the models, the intermediate models and
the interactions between all of them start getting sufficiently
complex, you will need to put new forms on front. Theoretically, you
don't want to store a "date" variable more than once for instance -
especially amongst things that are linked. my eg: School student
information system: courses, enrolments, tutorials, timetables,
students, attendance records and marks - the timetables, tutorials and
attendance will all need a date, but you only want one.

Using the provided admin to do this is possible, but it then creates
complex work flows and documentation - putting a new form on front can
smooth it out for users.

> What are the disadvantages of rewriting your own backend?

It's more work, more code, more files = greater complexity, more
places to go wrong.

cheers
L.

Lachlan Musicman

unread,
Sep 3, 2012, 5:54:50 PM9/3/12
to django...@googlegroups.com
Oh, and I forgot to mention, there's this video:

http://python.mirocommunity.org/video/1861/djangocon-2010-customizing-the

which I watched recently - it's a bit old, but interesting none the less

cheers
L.

Barry Morrison

unread,
Sep 3, 2012, 9:48:01 PM9/3/12
to django...@googlegroups.com
My $.02 cents.  It's great to have around while you're working, but my n00b experience taught me it left a lot to be desired so I rolled my own for the last two projects I built. 

FWIW, a local dev gave this quick presentation, and they did an incredible job on hacking the default admin https://speakerdeck.com/u/pamelafox/p/django-admin-widgetry-and-witchery but she has also said that she's working on a custom admin

So my advice. Use it as the tool that it is. Build what it can't do, don't spend more time on it than you have to. 

Frankline

unread,
Sep 4, 2012, 1:14:37 AM9/4/12
to django...@googlegroups.com
An example use case is if I need an admin backend with features for reports and graphs, aside from other site configurations.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/edKRzxuuHaIJ.

Tomas Neme

unread,
Sep 4, 2012, 9:50:09 AM9/4/12
to django...@googlegroups.com
> Anyway, to the question. Once the models, the intermediate models and
> the interactions between all of them start getting sufficiently
> complex, you will need to put new forms on front. Theoretically, you

I've a question about this. I tried to do something like this, but
using the main capabilities and hacking on the ModelAdmin classes,
changing the formsets and the like, and reusing as much as possible,
including of course the admin templates.

Of course, it wasn't possible. I was trying to do something as simple
as a double-indirection inline, a second-level foreign key, and ended
up just showing a link to the other model's admin page, creating,
indeed, a complex workflow where none was needed.

To what extent and how particularly would one need override a specific
admin page to do this kind of thing? Is reusing the templates at all
possible if you've customized things? Maybe the templates yes, but the
ModelAdmin views are impossible, I was in a hurry so I wasn't able to
do a good diagnosis of what would have been needed to do this.

Tomas

--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
Message has been deleted

Carlos Daniel Ruvalcaba Valenzuela

unread,
Sep 4, 2012, 3:48:19 PM9/4/12
to django...@googlegroups.com
Funny thing, this same question was asked a few years ago, the answare
was that the admin was flexible enough for anything and the preferred
way, only as last resort you would need to roll your own.

https://groups.google.com/d/topic/django-users/BwhAa_nJSAc/discussion

I'm still on the side of rolling your own.

Regards,
Carlos Daniel Ruvalcaba Valenzuela

Lachlan Musicman

unread,
Sep 4, 2012, 5:48:39 PM9/4/12
to django...@googlegroups.com
On Wed, Sep 5, 2012 at 1:50 AM, Tomas Neme <lacry...@gmail.com> wrote:
> I've a question about this. I tried to do something like this, but
> using the main capabilities and hacking on the ModelAdmin classes,
> changing the formsets and the like, and reusing as much as possible,
> including of course the admin templates.
>
> Of course, it wasn't possible. I was trying to do something as simple
> as a double-indirection inline, a second-level foreign key, and ended
> up just showing a link to the other model's admin page, creating,
> indeed, a complex workflow where none was needed.
>
> To what extent and how particularly would one need override a specific
> admin page to do this kind of thing? Is reusing the templates at all
> possible if you've customized things? Maybe the templates yes, but the
> ModelAdmin views are impossible, I was in a hurry so I wasn't able to
> do a good diagnosis of what would have been needed to do this.

I don't know either mate - I'm going to have to learn, and probably by
trial and error - there's not a lot of good documentation about this
use case or this need. I presume it's like the man pages, or Deleuze
and Guattari - impregnable to the neophyte, but once you no longer
really need them, they make sense. Is ok, here comes learning!

cheers
L.
Reply all
Reply to author
Forward
0 new messages