# Overriding Admin Template

**URL:** <https://forum.djangoproject.com/t/overriding-admin-template/2194>\
**Category:** Forms & APIs\
**Created:** [April 30, 2020, 9:55pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194 "2020-04-30T21:55:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gogojimny](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gogojimny/32/1111_2.png) [@gogojimny](https://forum.djangoproject.com/u/gogojimny)\
**Post date:** [April 30, 2020, 9:55pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/1 "2020-04-30T21:55:39Z")

</div>

I am new to django, I am following the user guide to modify admin template, however, got the following error when I put ‘DIRS’: [BASE\_DIR / ‘templates’], in my settings.py:

 ![2020-05-01_9-52-46](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/2/2945c5a3d54f53c4e06bf325e97b57a04b0a477b.jpeg)

my tree is like this:  
├── db.sqlite3  
├── manage.py  
├── mysite  
│ ├── asgi.py  
│ ├── **init**.py  
│ ├── **pycache**  
│ │ ├── **init**.cpython-37.pyc  
│ │ ├── settings.cpython-37.pyc  
│ │ ├── urls.cpython-37.pyc  
│ │ └── wsgi.cpython-37.pyc  
│ ├── settings.py  
│ ├── urls.py  
│ └── wsgi.py  
├── polls  
│ ├── admin.py  
│ ├── apps.py  
│ ├── **init**.py  
│ ├── migrations  
│ │ ├── 0001\_initial.py  
│ │ ├── **init**.py  
│ │ └── **pycache**  
│ │ ├── 0001\_initial.cpython-37.pyc  
│ │ └── **init**.cpython-37.pyc  
│ ├── models.py  
│ ├── **pycache**  
│ │ ├── admin.cpython-37.pyc  
│ │ ├── apps.cpython-37.pyc  
│ │ ├── **init**.cpython-37.pyc  
│ │ ├── models.cpython-37.pyc  
│ │ ├── tests.cpython-37.pyc  
│ │ ├── urls.cpython-37.pyc  
│ │ └── views.cpython-37.pyc  
│ ├── static  
│ │ └── polls  
│ │ ├── images  
│ │ │ └── bgimage.jpg  
│ │ └── style.css  
│ ├── templates  
│ │ └── polls  
│ │ ├── detail.html  
│ │ ├── index.html  
│ │ └── results.html  
│ ├── tests.py  
│ ├── urls.py  
│ └── views.py  
└── templates  
└── admin  
└── base\_site.html

I also changed base\_site.html to:

# My administration
but it doesn't work, not even able to runserver

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 30, 2020, 10:17pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/2 "2020-04-30T22:17:47Z")

</div>

What user guide are you following? (If it’s part of the regular Django documentation, then there might be a typo that needs to be fixed.)

What the intent of that statement is to concatenate two strings, base\_dir and ‘/templates’. So that line should look something more like this:

```
'DIRS': [BASE_DIR + '/templates'],

```

Ken

---

<div class="post-metadata">

**Author:** ![gogojimny](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gogojimny/32/1111_2.png) [@gogojimny](https://forum.djangoproject.com/u/gogojimny)\
**Post date:** [April 30, 2020, 10:46pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/3 "2020-04-30T22:46:35Z")

</div>

Ah, thanks, that worked. I use this guide:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/1/1a9e4872bcdf8efd99b481a192185d042e80f02c.png)

---

<div class="post-metadata">

**Author:** ![gogojimny](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gogojimny/32/1111_2.png) [@gogojimny](https://forum.djangoproject.com/u/gogojimny)\
**Post date:** [April 30, 2020, 10:47pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/4 "2020-04-30T22:47:11Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/7/79952061e5a6b2ea5407d572b22af53ba7dcbfa3.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 30, 2020, 11:05pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/5 "2020-04-30T23:05:57Z")

</div>

What page (url)? I’m not finding it on the web site.

---

<div class="post-metadata">

**Author:** ![adamchainz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/adamchainz/32/26_2.png) [@adamchainz](https://forum.djangoproject.com/u/adamchainz)\
**Post date:** [May 1, 2020, 4:43am UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/7 "2020-05-01T04:43:21Z")

</div>

This is due to the change in 3.1 to use pathlib for `BASE_DIR` in new projects. See my blog post: [https://adamj.eu/tech/2020/03/16/use-pathlib-in-your-django-project/](https://adamj.eu/tech/2020/03/16/use-pathlib-in-your-django-project/)

3.1 is not released yet, so using its documentation is a bit premature 🙂

---

<div class="post-metadata">

**Author:** ![michaeloliveraz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/michaeloliveraz/32/9672_2.png) [@michaeloliveraz](https://forum.djangoproject.com/u/michaeloliveraz)\
**Post date:** [August 13, 2022, 12:06pm UTC](https://forum.djangoproject.com/t/overriding-admin-template/2194/8 "2022-08-13T12:06:16Z")

</div>

In 4.1 it is

‘DIRS’: [os.path.join(BASE\_DIR, ‘templates’)],
