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