Opened 4 years ago

Closed 4 years ago

#14552 closed (wontfix)

Suggestion for a slightly better explanation of custom template tags

Reported by: ranmoshe Owned by: nobody
Component: Documentation Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by gabrielhurley)

In http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ there is a concise explanation of how to define a custom filter. It might be good to emphasize the need for an empty __init__.py file in the templatetags directory - right now it just appears in a 'suggested' directory structure, and one might just ignore it if one does not understand it's mandatory - happened to me.

Change History (1)

comment:1 Changed 4 years ago by gabrielhurley

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

That page already contain exactly what you're asking for under the heading Code Layout:

"If this doesn’t already exist, create it - don’t forget the __init__.py file to ensure the directory is treated as a Python package."

It is also noted in the sample directory structure. Doing more than that on this page would be redundant.

Thanks for the report, though!

Note: See TracTickets for help on using tickets.
Back to Top