Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#20417 closed Uncategorized (fixed)

Server restart needed to load new tags and filters

Reported by: Katya <internum.odium@…> Owned by: anonymous
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: timograham@…, zbigniew@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

https://docs.djangoproject.com/en/1.5/howto/custom-template-tags/

It would be nice to mention that to have new tags and filters loaded one should restart the server.

Attachments (1)

20417-Server restart needed to load new tags and filters (596 bytes ) - added by DjangoPanngo 12 years ago.
Suggested addition to the documentation.

Download all attachments as: .zip

Change History (19)

comment:1 by Baptiste Mispelon, 12 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

Hi,

I agree, this would be a welcome addition.

comment:2 by Daniele Procida, 12 years ago

Owner: changed from nobody to Daniele Procida
Status: newassigned

I have tentatively reserved this ticket for first-time committers who take part in the Don't be afraid to commit workshop at the DjangoCon Europe 2013 sprints on 18th and 19th May.

If you want to tackle this ticket before then, please don't let the fact that it's assigned to me stop you. Feel free to re-assign it to yourself and do whatever you like to it.

comment:3 by boromil, 12 years ago

Owner: changed from Daniele Procida to anonymous

comment:4 by DjangoPanngo, 12 years ago

Owner: changed from anonymous to DjangoPanngo

comment:5 by Krzysztof Malinowski <boromil@…>, 12 years ago

Owner: changed from DjangoPanngo to anonymous

by DjangoPanngo, 12 years ago

Suggested addition to the documentation.

comment:6 by DjangoPanngo, 12 years ago

Please review and advise if the layout/content/placement need to change.

comment:7 by DjangoPanngo, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Krzysztof Malinowski <boromil@…>, 12 years ago

Sorry about taking this ticket off you DjangoPanngo - I've tried before to sign it to myself but it only showed anonymous... anyway I also submitted a proposition through githubs pull request. Your look good to so let someone else decide.

comment:9 by DjangoPanngo, 12 years ago

Triage Stage: Ready for checkinAccepted

Moving this back to accepted because it's missing mentioning of filters.

comment:10 by boromil, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:11 by boromil, 12 years ago

This is the updated branch with the corrected info.

comment:12 by Tim Graham, 12 years ago

Cc: timograham@… added

I'm not sure exactly what requires reloading the server? I was testing with the staticfiles template tag and got an error "TemplateSyntaxError: Invalid block tag: 'static'". I then added "{% load staticfiles %}" to the template and didn't reload the development server, but the error was resolved when refreshing the page.

comment:13 by Tim Graham, 12 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

comment:14 by Zbigniew Siciarz, 12 years ago

Cc: zbigniew@… added

It's not about adding new {% load %} tags to the template. The reload is necessary when you add new Python module containing tags or filters definitions to the templatetags subdirectory of an app.

comment:15 by Tim Graham, 12 years ago

Tried that as well. Added {% load foo %} to a template without that module in myapp.templatetags and got the error:

TemplateSyntaxError:
  'foo' is not a valid tag library: Template library foo not found,
  tried django.templatetags.foo,myapp.templatetags.foo,etc.

Then added foo.py to myapp.templatetags and refreshed the page without reloading the server and the filter in "foo" worked.

comment:16 by Carl Meyer, 12 years ago

The problem occurs only when an app in INSTALLED_APPS does not have a templatetags submodule at all, and then one is added while the server is running; Django won't see it unless you restart the server.

Version 0, edited 12 years ago by Carl Meyer (next)

comment:17 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In a46a399534c26abd3f4984149b820f34869d6b74:

Fixed #20417 - Noted that a server restart is required to load new templatetag modules.

Thanks Katya for the suggestion.

comment:18 by Tim Graham <timograham@…>, 12 years ago

In 9ed2121eca0d4543dd665d7c5a3015beaee28eb4:

[1.5.x] Fixed #20417 - Noted that a server restart is required to load new templatetag modules.

Thanks Katya for the suggestion.

Backport of a46a399534 from master

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