Customization of Django admin page to add button - django

I want to add additional button in the admin page other than save , delete and save and continue button.I do know that I should change the default page of admin but I couldn't able to implement it.I can understand it theortically but not in practical.I want steps to change the default program of Django admin page.I need a demo for it.I need a little brief explaination.

go to your site packages directory then to django then contrib then admin and then templates. There you will find all the templates. Copy the templates, and then in your command line type manage.py collectstatics, now you have your admin templates and your admin statics files. You can modify this button

Related

Can I access my website from Django admin panel?

I am trying to develop a website where I can see the homepage as it is from Django admin panel. The reason I want that is I want to edit the name of the static content like 'Home' to 'All' along with the change of slide show picture. In summary, I want to change the website layout from Django admin panel that is not accessible to users. Is that possible? I just want an idea of how to implement the process.
Static texts you can change in admin panel with different modules:
for example django-rosetta or my own library Django-tof. https://github.com/wP-soft-GmbH/django-tof
But in your case, i think, you want to made something more.
For this case you can use django-flat-pages, already included in Django, if you have a static web-page.
you can edit every element on the page and after save, you can see it on the front.
if you really want to change the django templates, which you use in your views, you can create a simple template editor in the admin panel based on a widget like django-Ckeditor.

How to override Django admin delete_selected_confirmation.html

In my Django admin. If I delete anything in superadmin or inside an user created by superadmin it shows a confirmation page. I have delete_confirmation.html in my templates under my admin and in my another app.
If I change anything in it or add a line it doesn't change plus it shows objects in my page which I don't want. I don't know how to override it. Please refer to the image. My delete confirmation page
To override any template in a django project, you need to replicate the path of the template in your project's template directory.
This template is found in contrib/admin/templates/admin/delete_confirmation.html
Therefore in your template directory create a directory called admin and then delete_confirmation.html in that. This overrides the django template path in your templates.
You can then put whatever you want in it & repeat this for any other templates from installed packages.
Docs on overrides of admin templates; https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#admin-overriding-templates

Modify Django Admin Page

I have a django admin where the name for the login was changed and after logging in the page is cut off. I went in to modify the page but it appears there is no admin/index under templates. I have looked throughout the project and can not find it anywhere. Is there an easy way to locate the files needed to proceed with the project?

Sharing bootstrap template with django admin

What's the best way to share a bootstrap template between my own django app and the admin app?
I've got bootstrap working just fine for my own app - including a link in a menu to the admin app. I've also installed django-admin-bootstrapped, but that just gives me a completely separate bootstrap template.
I'd like my template to apply to both my own app and to the admin, so that my sysadmin users see the admin link and, when they're in the admin app, still see everything looking consistent and can easily get back to the main app.
Well you can just override the base admin template and use it in your app, take a look here overriding admin templates
But you can use the same base file for both the admin and your app views

How to change 'Django Administration' name to a custom name in admin login and admin page

I am trying to change the name of django administration to custom name how do i do that.Is there any way completely customize the admin page give it more professional look
There are several ways to customize the Django admin.
First of all, you can always override any template (see docs : https://docs.djangoproject.com/en/1.6/intro/tutorial02/#customize-the-admin-look-and-feel it is actually using this very case as example)
Starting with Django 1.7, it will be accessible via settings : https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-attributes
Finally, you could use a admin skin app such as the wonderful Grappelli wich already provides a similar setting : http://django-grappelli.readthedocs.org/en/latest/index.html
Hope this helps,
Regards,
Copy the admin templates to your project template folders (if you don't know how, just create an admin subdirectory in your project/templates folder).
The django branding is located in: base_site.html file.
You can find the source of it either in your django installed package or by checking the source code in github:
https://github.com/django/django/blob/stable/1.6.x/django/contrib/admin/templates/admin/base_site.html
Additionally with this method you can also completely override the default admin implementation, if you are not familiar or you don't want to spend so much time in it, you can also use a ready to use package such as grapelli: http://grappelliproject.com/ or django suit: http://djangosuit.com/
Note that branding will change in the next django release, the user will be able to define those in the settings file:
https://docs.djangoproject.com/en/dev/releases/1.7/#minor-features