# Certificate template doesn't work

**URL:** <https://discuss.openedx.org/t/certificate-template-doesnt-work/14879>\
**Category:** Tutor Help\
**Created:** [January 30, 2025, 3:30pm UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879 "2025-01-30T15:30:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![guren1290](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/guren1290/32/7910_2.png) [@guren1290](https://discuss.openedx.org/u/guren1290)\
**Post date:** [January 30, 2025, 3:30pm UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/1 "2025-01-30T15:30:04Z")

</div>

I have a certificate template registered in Django, when it is active, an error appears when generating the certificate ([https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/6/6f4588ec74369174ad33623805c382dab28c7e09.png](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/6/6f4588ec74369174ad33623805c382dab28c7e09.png)) , if I disable the certificate template, a standard certificate is generated. Tell me, what could be the matter?

If I remove this fragment with the print button from the template, the certificate is generated normally. I have a tutor 19.

- 

```
  <div>*

```

- 

```
  <font color="#000000" </font>*

```

- 

```
  	<h2>${accomplishment_banner_opening}</h2>*

```

- 

```
  	<p class="message-copy copy copy-base emphasized">${accomplishment_banner_congrats}</p>*

```

- 

```
  	<div class="message-actions">*

```

- 

```
  		<button class="inverse" id="action-print-view">*

```

- 

```
  			${_("Print Certificate")}*

```

- 

```
  		</button>*

```

- 

```
  	</div>*

```

- 

```
  </font>*

```

- 

```
  </div>*

```

- 

\*

---

<div class="post-metadata">

**Author:** ![Andres.Aulasneo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/andres.aulasneo/32/984_2.png) [@Andres.Aulasneo](https://discuss.openedx.org/u/Andres.Aulasneo)\
**Post date:** [January 30, 2025, 8:03pm UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/2 "2025-01-30T20:03:06Z")

</div>

Hi @guren1290, welcome to the community!  
Please check the logs in the LMS, this will give you a hint of what is wrong in the template.

---

<div class="post-metadata">

**Author:** ![guren1290](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/guren1290/32/7910_2.png) [@guren1290](https://discuss.openedx.org/u/guren1290)\
**Post date:** [January 31, 2025, 4:20am UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/3 "2025-01-31T04:20:07Z")

</div>

**Thank you for responding to my question. Please help me figure it out, I’m new to this**

⚠ You are running Tutor as root. This is strongly not recommended. If you are doing this in order to access the Docker daemon, you should instead add your user to the ‘docker’ group. (see [Post-installation steps | Docker Docs](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user))  
docker compose -f /root/.local/share/tutor/env/local/docker-compose.yml -f /root/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor\_local logs --follow --tail 100 lms  
lms-1 | File “/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py”, line 242, in get\_theme\_base\_dir  
lms-1 | raise ValueError(  
lms-1 | ValueError: Theme ‘branded’ not found in any of the following themes dirs,  
lms-1 | Theme dirs:  
lms-1 | [Path(‘/openedx/themes’)]  
lms-1 | 2025-01-31 04:12:48,986 ERROR 23 [openedx.core.djangoapps.theming.helpers] [user 5] [ip 192.168.159.238] helpers.py:209 - Theme not found in any of the themes dirs. [Theme ‘branded’ not found in any of the following themes dirs,  
lms-1 | Theme dirs:  
lms-1 | [Path(‘/openedx/themes’)]]  
lms-1 | Traceback (most recent call last):  
lms-1 | File “/openedx/edx-platform/common/djangoapps/util/views.py”, line 139, in inner  
lms-1 | return func(request, \*args, \*\*kwargs)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/edx\_django\_utils/plugins/pluggable\_override.py”, line 77, in wrapper  
lms-1 | return prev\_fn(\*args, \*\*kwargs)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py”, line 607, in render\_html\_view  
lms-1 | response = \_render\_valid\_certificate(request, context, custom\_template)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py”, line 695, in \_render\_valid\_certificate  
lms-1 | return HttpResponse(template.render(context))  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/common/djangoapps/edxmako/template.py”, line 82, in render  
lms-1 | return self.mako\_template.render\_unicode(\*\*context\_dictionary)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/template.py”, line 443, in render\_unicode  
lms-1 | return runtime.\_render(  
lms-1 | ^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 874, in \_render  
lms-1 | \_render\_context(  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 916, in \_render\_context  
lms-1 | \_exec\_template(inherit, lclcontext, args=args, kwargs=kwargs)  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 943, in _exec\_template  
lms-1 | callable_(context, \*args, \*\*kwargs)  
lms-1 | File “memory:0x7b723c97f650”, line 47, in render\_body  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/filters.py”, line 47, in decode  
lms-1 | return decode(str(x))  
lms-1 | ^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 230, in **str**  
lms-1 | raise NameError(“Undefined”)  
lms-1 | NameError: Undefined  
lms-1 |  
lms-1 | During handling of the above exception, another exception occurred:  
lms-1 |  
lms-1 | Traceback (most recent call last):  
lms-1 | File “/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py”, line 204, in get\_current\_theme  
lms-1 | themes\_base\_dir=get\_theme\_base\_dir(site\_theme.theme\_dir\_name),  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py”, line 242, in get\_theme\_base\_dir  
lms-1 | raise ValueError(  
lms-1 | ValueError: Theme ‘branded’ not found in any of the following themes dirs,  
lms-1 | Theme dirs:  
lms-1 | [Path(‘/openedx/themes’)]  
lms-1 | 2025-01-31 04:12:48,989 ERROR 23 [openedx.core.djangoapps.theming.helpers] [user 5] [ip 192.168.159.238] helpers.py:209 - Theme not found in any of the themes dirs. [Theme ‘branded’ not found in any of the following themes dirs,  
lms-1 | Theme dirs:  
lms-1 | [Path(‘/openedx/themes’)]]  
lms-1 | Traceback (most recent call last):  
lms-1 | File “/openedx/edx-platform/common/djangoapps/util/views.py”, line 139, in inner  
lms-1 | return func(request, \*args, \*\*kwargs)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/edx\_django\_utils/plugins/pluggable\_override.py”, line 77, in wrapper  
lms-1 | return prev\_fn(\*args, \*\*kwargs)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py”, line 607, in render\_html\_view  
lms-1 | response = \_render\_valid\_certificate(request, context, custom\_template)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py”, line 695, in \_render\_valid\_certificate  
lms-1 | return HttpResponse(template.render(context))  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/common/djangoapps/edxmako/template.py”, line 82, in render  
lms-1 | return self.mako\_template.render\_unicode(\*\*context\_dictionary)  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/template.py”, line 443, in render\_unicode  
lms-1 | return runtime.\_render(  
lms-1 | ^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 874, in \_render  
lms-1 | \_render\_context(  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 916, in \_render\_context  
lms-1 | \_exec\_template(inherit, lclcontext, args=args, kwargs=kwargs)  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 943, in _exec\_template  
lms-1 | callable_(context, \*args, \*\*kwargs)  
lms-1 | File “memory:0x7b723c97f650”, line 47, in render\_body  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/filters.py”, line 47, in decode  
lms-1 | return decode(str(x))  
lms-1 | ^^^^^^  
lms-1 | File “/openedx/venv/lib/python3.11/site-packages/mako/runtime.py”, line 230, in **str**  
lms-1 | raise NameError(“Undefined”)  
lms-1 | NameError: Undefined  
lms-1 |  
lms-1 | During handling of the above exception, another exception occurred:  
lms-1 |  
lms-1 | Traceback (most recent call last):  
lms-1 | File “/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py”, line 204, in get\_current\_theme  
lms-1 | themes\_base\_dir=get\_theme\_base\_dir(site\_theme.theme\_dir\_name),  
lms-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
lms-1 | File “/openedx/edx-platform/openedx/core/djangoapps/theming/helpers.py”, line 242, in get\_theme\_base\_dir  
lms-1 | raise ValueError(  
lms-1 | ValueError: Theme ‘branded’ not found in any of the following themes dirs,  
lms-1 | Theme dirs:  
lms-1 | [Path(‘/openedx/themes’)]  
lms-1 | [pid: 23|app: 0|req: 161/388] 192.168.101.4 () {46 vars in 3159 bytes} [Fri Jan 31 04:12:48 2025] GET /certificates/course/course-v1:kursy\_pok+1+1?preview=honor =\> generated 9871 bytes in 485 msecs (HTTP/1.1 200) 8 headers in 477 bytes (1 switches on core 0)

---

<div class="post-metadata">

**Author:** ![rax](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rax](https://discuss.openedx.org/u/rax)\
**Post date:** [February 5, 2025, 9:33am UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/4 "2025-02-05T09:33:15Z")

</div>

Hello @guren1290

I’m pretty sure the problem is “${\_(“Print Certificate”)}\*” but if you want you can use this template:

[cert\_template.txt](https://discuss.openedx.org/uploads/short-url/xFnirHCm8ZXEIsefHRkbwJH6tbU.txt) (7.1 KB)

Also make sure the course start and end dates are set correctly if your course pace is set to “Instructor Pace” (in my experience I recommend using “self-paced” and enabling certificate auto-generation).

good luck,  
rax

---

<div class="post-metadata">

**Author:** ![guren1290](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/guren1290/32/7910_2.png) [@guren1290](https://discuss.openedx.org/u/guren1290)\
**Post date:** [February 7, 2025, 6:14am UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/5 "2025-02-07T06:14:34Z")

</div>

Thank you, you helped me a lot

---

<div class="post-metadata">

**Author:** ![jimenez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/jimenez/32/7500_2.png) [@jimenez](https://discuss.openedx.org/u/jimenez)\
**Post date:** [December 13, 2025, 4:32am UTC](https://discuss.openedx.org/t/certificate-template-doesnt-work/14879/6 "2025-12-13T04:32:20Z")

</div>

Hello, could you help me with the configuration? I already added the

CUSTOM\_CERTIFICATE\_TEMPLATES\_ENABLED  
CERTIFICATES\_HTML\_VIEW

I also added the templates in admin/certificate/certificate templates, but it doesn’t apply the customization. Did you do any extra step? I still have Tutor V19
