#20417 closed Uncategorized (fixed)
Server restart needed to load new tags and filters
Reported by: | 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)
Change History (19)
comment:1 Changed 10 years ago by
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 Changed 10 years ago by
Owner: | changed from nobody to Daniele Procida |
---|---|
Status: | new → assigned |
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 Changed 10 years ago by
Owner: | changed from Daniele Procida to anonymous |
---|
comment:4 Changed 10 years ago by
Owner: | changed from anonymous to DjangoPanngo |
---|
comment:5 Changed 10 years ago by
Owner: | changed from DjangoPanngo to anonymous |
---|
Changed 10 years ago by
Attachment: | 20417-Server restart needed to load new tags and filters added |
---|
Suggested addition to the documentation.
comment:6 Changed 10 years ago by
Please review and advise if the layout/content/placement need to change.
comment:7 Changed 10 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 Changed 10 years ago by
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 Changed 10 years ago by
Triage Stage: | Ready for checkin → Accepted |
---|
Moving this back to accepted because it's missing mentioning of filters.
comment:10 Changed 10 years ago by
Triage Stage: | Accepted → Ready for checkin |
---|
comment:12 Changed 10 years ago by
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 Changed 10 years ago by
Has patch: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Ready for checkin → Accepted |
comment:14 Changed 10 years ago by
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 Changed 10 years ago by
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 Changed 10 years ago by
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.
comment:17 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Hi,
I agree, this would be a welcome addition.