Hello this is my first time here.
So I am trying to create directory index to serve static files uploaded by users by using inbuilt view by adding this to my urlpatterns -
from django.views.static import serve
url(r'^uploads/(?P<path>.*)', serve, {
'document_root': settings.UPLOAD_DIR,
'show_indexes': True,
},name="index_home"),
]
this gave me
TemplateSyntaxError at /uploads/
'i18n' is not a registered tag library. Must be one of:
when trying to access the url with debug=True.
I tried to register the tag library by adding this to my settings.py in in TEMPLATES OPTIONS as described here and here.
'libraries': {
'staticfiles' : 'django.templatetags.static',
'i18n' : 'django.templatetags.i18n',
},
but still no luck. Can anyone help me with what is going wrong?
Thanks