0

I have been following this post

However I do not understand this part in which the answer states

In url.py

from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [....
]
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Now

In my project if I add

+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

after my

 urlpatterns = [....
    ]

I get the error

    + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
TypeError: bad operand type for unary +: 'list'

any suggestions on how i can fix this ?

Community
  • 1
  • 1
James Franco
  • 4,516
  • 10
  • 38
  • 80

1 Answers1

3
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Cadmus
  • 665
  • 7
  • 13