#26973: i18n template tag loading error when setting 'show_indexes' to True
---------------------------------+--------------------------------------
Reporter: MikiSoft | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by MikiSoft):
* needs_better_patch: => 0
* component: File uploads/storage => Template system
* needs_tests: => 0
* needs_docs: => 0
Old description:
> 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` folder in the project root make a directory and pu
> some file(s) in it.
> The last step will be to start the server and to go to that directory
> (e.g. [http://127.0.0.1/static]), where response should be a directory
> listing of that folder, but you'll see this odd error:
> `'i18n' is not a registered tag library.`
New description:
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.`
--
--
Ticket URL: <https://code.djangoproject.com/ticket/26973#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.54e1ae56178a3aa8751a9b8a16710bac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.