How is it possible to inherit the base admin page and design custom templates (pages)? I don’t want to extend or overwrite the admin pages.
Thanks
~oneflydown
How is it possible to inherit the base admin page and design custom templates (pages)? I don’t want to extend or overwrite the admin pages.
Thanks
~oneflydown
If you want to user the admin CSS you just need to call this static files in templates:
You can extends de admin/base.html template and start to make your own template. Admin CSS and JavaScript use has many advantages, It is very light, has many components samples in the templates/admin directory, you can easy customize it with CSS Variables, is very easy to extends and the admin it self includes Jquery. I have think in that a lot, but I end using Bootstrap all the time.
Thanks for the reply.
I have tried extending the admin change_form.html.
In app/templates/app/ I have my html which extends {% extends "admin/change_form.html" %}.
And the admin forms are placed in templates/admin/app/model/change_form.html.
While I am able to extend the registration forms, I am getting the following error when extending change_form on a model.
Reverse for ‘app_list’ with keyword arguments ‘{‘app_label’: ‘’}’ not found. 1 pattern(s) tried: [‘admin/(?P<app_label>auth|app|users)/$’]
Any help is appreciated.
Thanks
~Oneflydown
When I am extending {% extends "admin/base.html" %}.
I am not getting the above error.
Thanks
~Oneflydown
Since I cannot upload more than one media, I am doing multiple posts.
This is my admin page and is working fine.
When I am extending admin\base.html in a template called from view, I am not getting any error:
but error when I extend admin\change_form.html in a template called from view.
In general, this error is saying your template is trying to use the url
tag for a url named app_list
that requires a parameter that you are not supplying - in this case, app_label
. You’ll want to examine the template you are extending to find where that url is being rendered to see what parameter is being used in that tag. You then need to ensure that that parameter is supplied to that template by including it in your context.
I resolved the reverse for app_list by passing context to the template from my view. However, I am getting KeyError at Add in admin/base.html. Do I need to extend the admin/base.html also? which I am not doing.
Thanks
~Oneflydown
This was solved by passing the required keys into the context.
Thanks
~
If you want to use lot of features of the Admin you should better create a Custom Admin Site and you can override templates by App. I think it would be a better approach in your case.