Opened 8 years ago
Last modified 8 years ago
#26973 closed Bug
i18n template tag loading error when setting 'show_indexes' to True — at Version 1
Reported by: | MikiSoft | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
This is a bug related to the django.views.static.serve
and it's reproduced very easily.
First, create a new Django project and add these constants in settings.py
:
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
Then, in urls.py
add this code:
from django.conf import settings from django.views.static import serve if settings.DEBUG: urlpatterns += url(r'^'+settings.STATIC_URL[1:]+'(?P<path>.*)$', serve, {'document_root': settings.STATIC_ROOT, 'show_indexes': True})]
Then create static
directory in the project root and put some file(s) in it.
The last step will be to start the development server and to go to that directory (e.g. http://127.0.0.1/static), where response should be the directory listing, but you'll see this odd error:
'i18n' is not a registered tag library.
Change History (1)
comment:1 by , 8 years ago
Component: | File uploads/storage → Template system |
---|---|
Description: | modified (diff) |