{"id":75646,"date":"2020-01-20T11:25:40","date_gmt":"2020-01-20T05:55:40","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=75646"},"modified":"2024-04-12T14:17:14","modified_gmt":"2024-04-12T08:47:14","slug":"customizing-the-admin-interfaces-look-and-feel","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/","title":{"rendered":"Customizing the Admin Interface\u2019s Look and Feel"},"content":{"rendered":"<p>Clearly, having the phrase \u201cDjango administration\u201d at the top of each admin page is ridiculous. It\u2019s just placeholder text. It\u2019s easy to change, though, using Django\u2019s template system. The Django admin site is powered by Django itself, and its interfaces use Django\u2019s own template system.<\/p>\n<p>As we explained in Chapter 4, the TEMPLATE_DIRS setting specifies a list of directories to check when loading Django templates. To customize Django\u2019s admin templates, simply copy the relevant stock admin template from the Django distribution into your one of the directories pointed-to by TEMPLATE_DIRS.<\/p>\n<p>The admin site finds the \u201cDjango administration\u201d header by looking for the template admin\/base_site.html. By default, this template lives in the Django admin template directory, django\/contrib\/admin\/templates, which you can find by looking in your Python site-packages directory, or wherever Django was installed. To customize this base_site.html template, copy that template into an admin subdirectory of whichever directory you\u2019re using in TEMPLATE_DIRS. For example, if your TEMPLATE_DIRS includes &#8220;\/home\/mytemplates&#8221;, then copy django\/contrib\/admin\/templates\/admin\/base_site.html to \/home\/mytemplates\/admin\/base_site.html. Don\u2019t forget that admin subdirectory.<\/p>\n<p>Then, just edit the new admin\/base_site.html file to replace the generic Django text with your own site\u2019s name as you see fit. Note that any of Django\u2019s default admin templates can be overridden. To override a template, just do the same thing you did with base_site.html: copy it from the default directory into your custom directory and make changes to the copy.<\/p>\n<p>You might wonder how, if TEMPLATE_DIRS was empty by default, Django found the default admin templates. The answer is that, by default, Django automatically looks for templates within a templates\/ subdirectory in each application package as a fallback. See the \u201cWriting Custom Template Loaders\u201d in Chapter 10 for more information about how this works.<\/p>\n<p><strong>Customizing the Admin Index Page<\/strong> &#8211; On a similar note, you might want to customize the look and feel of the Django admin index page. By default, it displays all available applications, according to your INSTALLED_APPS setting, sorted by the name of the application. You might, however, want to change this order to make it easier to find the applications you\u2019re looking for. After all, the index is probably the most important page of the admin interface, so it should be easy to use.<\/p>\n<p>The template to customize is admin\/index.html. (Remember to copy admin\/index.html to your custom template directory as in the previous example.) Edit the file, and you\u2019ll see it uses a template tag called {% get_admin_app_list as app_list %}. This tag retrieves every installed Django application. Instead of using the tag, you can hard-code links to object-specific admin pages in whatever way you think is best. If hard-coding links doesn\u2019t appeal to you, see Chapter 10 for details on implementing your own template tags.<\/p>\n<p>Django offers another shortcut in this department. Run the command python manage.py adminindex &lt;app&gt; to get a chunk of template code for inclusion in the admin index template. It\u2019s a useful starting point.<\/p>\n\n\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/certified-django-developer\/\" target=\"_blank\" rel=\"noreferrer noopener\">Back to Tutorial<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clearly, having the phrase \u201cDjango administration\u201d at the top of each admin page is ridiculous. It\u2019s just placeholder text. It\u2019s easy to change, though, using Django\u2019s template system. The Django admin site is powered by Django itself, and its interfaces use Django\u2019s own template system. As we explained in Chapter 4, the TEMPLATE_DIRS setting specifies&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8655],"tags":[2615],"class_list":["post-75646","page","type-page","status-publish","hentry","category-django-web-development","tag-customizing-the-admin-interface"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Customizing the Admin Interface\u2019s Look and Feel - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Customizing the Admin Interface\u2019s Look and Feel - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Clearly, having the phrase \u201cDjango administration\u201d at the top of each admin page is ridiculous. It\u2019s just placeholder text. It\u2019s easy to change, though, using Django\u2019s template system. The Django admin site is powered by Django itself, and its interfaces use Django\u2019s own template system. As we explained in Chapter 4, the TEMPLATE_DIRS setting specifies...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:47:14+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/\",\"name\":\"Customizing the Admin Interface\u2019s Look and Feel - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2020-01-20T05:55:40+00:00\",\"dateModified\":\"2024-04-12T08:47:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Customizing the Admin Interface\u2019s Look and Feel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Customizing the Admin Interface\u2019s Look and Feel - Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/","og_locale":"en_US","og_type":"article","og_title":"Customizing the Admin Interface\u2019s Look and Feel - Tutorial","og_description":"Clearly, having the phrase \u201cDjango administration\u201d at the top of each admin page is ridiculous. It\u2019s just placeholder text. It\u2019s easy to change, though, using Django\u2019s template system. The Django admin site is powered by Django itself, and its interfaces use Django\u2019s own template system. As we explained in Chapter 4, the TEMPLATE_DIRS setting specifies...","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:47:14+00:00","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/","name":"Customizing the Admin Interface\u2019s Look and Feel - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2020-01-20T05:55:40+00:00","dateModified":"2024-04-12T08:47:14+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/customizing-the-admin-interfaces-look-and-feel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Customizing the Admin Interface\u2019s Look and Feel"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=75646"}],"version-history":[{"count":4,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75646\/revisions"}],"predecessor-version":[{"id":83345,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/75646\/revisions\/83345"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=75646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=75646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=75646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}