2👍
✅
Ok, here is the solution:
https://docs.djangoproject.com/en/1.9/howto/static-files/#serving-static-files-during-development
The issue was that I was testing django-filebrowser with development server
0👍
You are not putting url for displaying image.
In setting.py-
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
MEDIA_URL = '/media/'
In URLs.py--
Url(r'^media/(?^<path>.*)$','django.views.static.serve',{'document_root':
settings.MEDIA_ROOT,}),
I think it can help you
- [Answered ]-Checking boxes for items passed through context in Django
- [Answered ]-Django DetailView with form for comments
- [Answered ]-Django modelformset_factory doesn't include actual forms
- [Answered ]-Cant figure out right queryset for json in django
- [Answered ]-Django: send_mail not working [only for production]
0👍
You can do:
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
#your urls
]
if settings.DEBUG: # will be 'True' in development
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
- [Answered ]-DisallowedHost at / even though ALLOWED_HOSTS are correct
- [Answered ]-Special characters in filenames and paths
- [Answered ]-Django validator not triggering on file upload
- [Answered ]-Django ManyToManyField as multiset
- [Answered ]-Signature error message when uploading file with fineuploader and django into S3
Source:stackexchange.com