views:

831

answers:

4

I was thinking that django admin is an utility to provide trusted administrators of the site, full access to the site's data model.

However, after going through django admin in detail, I understand that it is very powerful set of views and templates that one can use to create an entire application.

How often do you create an entire application using admin alone? Is it easier to create using views itself than customizing admin that much?

How about building prototype using admin. Do we even need to build prototype? The admin customization cannot be re-used in real application.

If I want to use a part of the admin code in real application (with different templates), is there some kind of scaffolding option available?

A: 

In short:

Try out the admin part for your needs. Modify the standard views. If there is something missing, you can always develop your own view.

For me, I can't imagine an entire (bigger than rolodex) application based only on django-admin.

A.

+2  A: 

I have done something like that before. It was a CMS for a university completely implemented by extending Django admin. It turned out it was a bad design descision. I had to jump through hoops to do some things.

It really depends on what the requirements are for your application. If there needs to be lots of ajax or some specific workflow extending the admin will not be the right thing to do. But I think 60% of cases can be covered by extending the admin.

It's also excellent for building prototypes.

Vasil
+10  A: 

"The Admin is not your app."

If the customization goes beyond the trivial, write your own views.

In my experience, I leave the internal admin pages relatively untouched. Instead, I override the admin index template, where I put links to custom-written views when the user needs to do nontrivial reporting or form handling.

AdamKG
+1  A: 

The Django Admin is incredibly flexible and can be overridden in multiple ways. Unfortunately there is more than one way to do the overriding and some of the techniques are not terribly well documented.

The good news is that the following strategy seems to work well: Override, customize and subclass the admin app until it all starts feeling a little painful and at that point just drop into your own views where needed.

There's some useful links in my answer to this question

andybak