[Django] #31482: The templatetags folder doesn't need to be a package.

9 views
Skip to first unread message

Django

unread,
Apr 19, 2020, 5:41:32 PM4/19/20
to django-...@googlegroups.com
#31482: The templatetags folder doesn't need to be a package.
-------------------------------------+-------------------------------------
Reporter: Nat S | Owner: nobody
Dunn |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.0
Documentation |
Severity: Normal | Keywords: templatetags
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
In [https://docs.djangoproject.com/en/3.0/howto/custom-template-tags| the
documentation], it says "The app should contain a templatetags directory,
at the same level as models.py, views.py, etc. 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**."

The directory doesn't need to be a package.

--
Ticket URL: <https://code.djangoproject.com/ticket/31482>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 20, 2020, 2:43:37 PM4/20/20
to django-...@googlegroups.com
#31482: The templatetags folder doesn't need to be a package.
-------------------------------------+-------------------------------------
Reporter: Nat S Dunn | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 3.0
Severity: Normal | Resolution:
Keywords: templatetags | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ian Bottomley):

* cc: Ian Bottomley (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/31482#comment:1>

Django

unread,
Apr 21, 2020, 3:53:12 AM4/21/20
to django-...@googlegroups.com
#31482: The templatetags folder doesn't need to be a package.
-------------------------------------+-------------------------------------
Reporter: Nat S Dunn | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Documentation | Version: 3.0
Severity: Normal | Resolution: wontfix

Keywords: templatetags | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => wontfix


Comment:

> The directory doesn't need to be a package.

Not seeing this at all. `templatetags` contains `.py` modules with the
custom tag implementations — it just is a package.

Whether there's a `__init__.py` determines whether it's a regular or
namespace package, as per [https://www.python.org/dev/peps/pep-0420/ PEP
420].

I can't see any benefit in not recommending a regular package here.

--
Ticket URL: <https://code.djangoproject.com/ticket/31482#comment:2>

Reply all
Reply to author
Forward
0 new messages