Take the 2-minute tour ×

I want to use the existing Django Admin template for a form of my own. The situation is like there are two models. say A and B and I want a form that displays the details about both the models in a songle form of my own. So I am using a ModelForm. But I want to use the templates from the django admin. How can I do that?

share|improve this question
You can extends from (pastebin.com/fT69Tuku) admin/base_site.html sorry if this is in spanish –  Victor Castillo Torres Jun 20 '13 at 0:22
@VictorCastilloTorres Unknown paste id? –  Indradhanush Gupta Jun 20 '13 at 0:23
@IndaradhanushGupta Now? –  Victor Castillo Torres Jun 20 '13 at 0:25
@VictorCastilloTorres yeah. thanks. :) –  Indradhanush Gupta Jun 20 '13 at 0:34

2 Answers 2

I think its better to override the admin interface. https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

share|improve this answer

Would a Class-based generic view work for you?

share|improve this answer
Not sure about that. Overriding the admin feels good. But how do you think I can use both the models in one form? Any ideas? –  Indradhanush Gupta Jun 20 '13 at 0:28
Yes, you can use two models in one form but it brings up questions on functionality. Mainly, how do you want to interact with two models on one page? You should try and find a form that mimics the one you want and then copy it. –  Brent Washburne Jun 20 '13 at 0:38
Im considering over riding the model admin to include the functionalities of two models into one ModelAdmin. How can this be done? Check this question : stackoverflow.com/questions/17203589/… –  Indradhanush Gupta Jun 20 '13 at 0:42
There is not enough information here to answer your question. Post your models and code, and ask a more specific question. –  Brent Washburne Jun 20 '13 at 16:31

Your Answer


