# Django's template language is not being properly interpreted in the text file loaded into the Django template

**URL:** <https://forum.djangoproject.com/t/djangos-template-language-is-not-being-properly-interpreted-in-the-text-file-loaded-into-the-django-template/28230>\
**Category:** Templates & Frontend\
**Created:** [February 19, 2024, 4:24pm UTC](https://forum.djangoproject.com/t/djangos-template-language-is-not-being-properly-interpreted-in-the-text-file-loaded-into-the-django-template/28230 "2024-02-19T16:24:27Z")\
**Posts on this page:** 1\
**Showing post:** 12

<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:** [February 20, 2024, 3:57pm UTC](https://forum.djangoproject.com/t/djangos-template-language-is-not-being-properly-interpreted-in-the-text-file-loaded-into-the-django-template/28230/12 "2024-02-20T15:57:25Z")

</div>

Note: While this is close to what I suggested as #1 above, I had a slightly different idea in mind:

The view:

> [@nanorepublica](#):
>
> ```auto
> def tuto(request, tuto_id):    
> context = {
> 'tuto_template': f'tuto_{str(tuto_id).zfill(2)}.html',
> }    
> return render(request, 'tuto.html', context)
> 
> ```

Then, in the `tuto.html` template:

```auto
{% extends 'base.html' %}
{% load static %}
{% load crispy_forms_tags %}
{% block content %}
<h1>Tutorial {{ tuto_id }}</h1>
<div>
  {% include tuto_template %}
</div>
{% endblock content %}

```

The key limitation of this technique, however, is that these files need to be in the template directory. If you’re looking at doing this with user-editable files, something that would likely reside in your `MEDIA_DIR`, then this is not an appropriate approach. (It’s not clear from this post whether this is an issue or something that needs to be accounted for.)

---

_[View the full topic](https://forum.djangoproject.com/t/djangos-template-language-is-not-being-properly-interpreted-in-the-text-file-loaded-into-the-django-template/28230)._
