[Answered ]-TypeError: 'function' object has no attribute '__getitem__'; MEDIA_URL

2👍

The problem is here:

urlpatterns = patterns['', # <- see how you are trying to access patterns

Instead, define the urlpatterns simply as a list:

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('index.urls', namespace='index')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
👤alecxe

Leave a comment