Hello everyone,
I'm practicing on my first project on Django.
I've been searching for an answer for 2 hours now, I think I need some help (it seems not that complicated π₯² ).
I'm using a template in my application and Django doesn't find it, I don't understand why.
My file views.py looks like this :
from django.http import HttpResponse
from django.template import loader
def users(request):
template = loader.get_template('peoplebooks/base.html')
...
return HttpResponse(template.render(context, request))
```
____
The project is build like this :
π PeopleBook
π PeopleBook
π peoplebooks *(the app)*
π migrations
π static
π templates
π peoplebooks
< > base.html
< > users_detail.html
< > users_list.html
____
I have the error message :
```
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.app_directories.Loader: /Users/.../PeopleBook/PeopleBook/.venv/lib/python3.12/site-packages/django/contrib/admin/templates/peoplebooks/base.html (Source does not exist)
django.template.loaders.app_directories.Loader: /Users/.../PeopleBook/PeopleBook/.venv/lib/python3.12/site-packages/django/contrib/auth/templates/peoplebooks/base.html (Source does not exist)
```
____
I've tried different names...
I've tried to import os in the settings.py and added this : SETTINGS_PATH = os.path.dirname(os.path.dirname(__file__)).
Sorry for the long post, if you have anything I could try/take a look at, it would be very helpful.
Thank you in advance !