Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load templates from template engines’ DIRS setting #145

Merged
merged 2 commits into from
May 20, 2021

Conversation

thibaudcolas
Copy link
Member

Description

This makes the pattern library search for templates both in DIRS directories for template engines, and in the templates subdirectory inside each installed application if using APP_DIRS as it was before.

This is necessary so the package is usable for projects that don’t use APP_DIRS.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added an appropriate CHANGELOG entry

@thibaudcolas thibaudcolas added enhancement New feature or request django Related to Django templates capabilities labels May 19, 2021
@thibaudcolas thibaudcolas added this to the Nice to have milestone May 19, 2021
Copy link
Collaborator

@bcdickinson bcdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, thanks Thibaud. I had some very minor feedback about commenting the lines that manipulate the directory lists in the tests.

tests/tests/test_utils.py Outdated Show resolved Hide resolved
tests/tests/test_utils.py Outdated Show resolved Hide resolved
@thibaudcolas thibaudcolas force-pushed the feature/load-templates-dirs branch 4 times, most recently from 99f6deb to 8d93a3a Compare May 20, 2021 13:30
@thibaudcolas
Copy link
Member Author

Thank you @bcdickinson! I’ve refactored the tests, and also fixed a compatibility issue with Django 3.2 (dir entries are now pathlib.Path instances). I made no changes to the actual implementation so will now merge without further review.

@thibaudcolas thibaudcolas merged commit a96b88d into master May 20, 2021
@thibaudcolas thibaudcolas deleted the feature/load-templates-dirs branch May 20, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
django Related to Django templates capabilities enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants