5. You want to organize templates so that some are shared across the project and others are app-specific. How should you configure TEMPLATES to achieve this?
hard
A. Set APP_DIRS=True and add the shared templates folder path to DIRS
B. Set APP_DIRS=False and put all templates in one shared folder listed in DIRS
C. Put all templates inside app folders and leave DIRS empty
D. Disable APP_DIRS and duplicate shared templates inside each app
Solution
Step 1: Enable automatic app template loading
Setting APP_DIRS=True allows Django to find templates inside each app's templates folder.
Step 2: Add shared templates folder to DIRS
Adding the shared folder path to DIRS lets Django find templates used across the whole project.
Final Answer:
Set APP_DIRS=True and add the shared templates folder path to DIRS -> Option A
Quick Check:
APP_DIRS + DIRS for shared + app templates [OK]
Hint: Use APP_DIRS=True plus shared folder in DIRS [OK]
Common Mistakes:
Disabling APP_DIRS and expecting app templates found
Duplicating shared templates inside apps
Leaving DIRS empty and missing shared templates
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.