Skip to content

Fix typo in documentation#446

Merged
danirus merged 1 commit intodanirus:masterfrom
tkin91e55:fixtypo2
Jan 7, 2025
Merged

Fix typo in documentation#446
danirus merged 1 commit intodanirus:masterfrom
tkin91e55:fixtypo2

Conversation

@tkin91e55
Copy link
Contributor

May remind user the template overriding order somewhere in documentation.
For example:

  1. use the Template filesystem loader to prioritize the extra template loading rather than App dirs
TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [
            BASE_DIR / "base" / "templates",  # base/ is not an app, extra dir for FileSystemTemplate
        ],
        # ....
    },
]
  1. Mind the app load order which decide the template loaded
INSTALLED_APPS=
[
  'myblog', # go before
  # ....
  'django_comments_xtd'
]

# instead of
INSTALLED_APPS=
[
  'django_comments_xtd',
   # ....
  'myblog', # go before
]

Refer to django-contrib-comments, https://github.com/django/django-contrib-comments/blob/2.2.0/django_comments/templatetags/comments.py#L184

if the app specific template search is supported, it would be nicer.

* The INSTALLED_APP order matters for the template overriding
  user's own app order should go before django_comments_xtd
@danirus
Copy link
Owner

danirus commented Jan 7, 2025

Thanks for the fix, @tkin91e55.

And yes, I think it makes sense to add a reminder of the template loading order in the docs.
Maybe a new first section in the templates.rst page. And linking to it from the tutorial.rst, on every mention to the template loading order.

I can add it, but if you prefer it, you can add it in this very PR too.

@danirus danirus merged commit 3063f0d into danirus:master Jan 7, 2025
6 checks passed
@danirus danirus mentioned this pull request Jan 7, 2025
@danirus
Copy link
Owner

danirus commented Jan 7, 2025

Docs extended in PR 449.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants