I'm stuck with not loading media files for 2 days and I would appreciate any ideas because I have run out of them. Here is my code:
Settings.py (main folder)
MEDIA_ROOT = '/home/conspects/conspects/media/'
MEDIA_URL = '/media/'
In my webapp page in static files section everything coincides: URL Directory /media/ /home/conspects/conspects/media/
I have tried playing with adding / and deleting, all variants, reloading server everytime - and nothing
Urls.py (main folder)
urlpatterns += static(MEDIA_URL, document_root=MEDIA_ROOT) + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
Model.py (other folder)
image = models.ImageField('image_name', max_length=254)
I render all images in my views.py as 'conspects' and here is my rendered template:
{% for conspect in conspects %}
<a href="{{conspect.image.url}}">
<img class="img" src="{{conspect.image.url}}"></img>
</a>
{% endfor %}
Hope you'll see a mistake!