Questions tagged [django-media]
237 questions
2
votes
1 answer
images are not saved in media directory in Django project
I'm trying to upload a picture (with Postman at the moment) and save it in the "media" directory but although the server returns 200 status code, nothing's saved in the project.
urls.py:
urlpatterns = [
path('users/sign-up',…

Masih Bahmani
- 153
- 2
- 10
2
votes
0 answers
Django media files get 403 forbidden
I have an app running on a Digital Ocean Droplet. I'm using Ubuntu, Nginx and Gunicorn
The admin can upload media files, the upload is working fine.
The problem is that when a user visits the site, the media files that the admin uploaded are not…

qwerty000
- 176
- 11
2
votes
1 answer
how to serve django media files in LiteSpeed webserver
I deployed a django project on shared host , and my media files did not loadedproduct image not load
what config do i do for fix this issue?
setting.py
STATIC_URL = '/site_statics/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR,…

Hamid Reza Mojtahed
- 25
- 4
2
votes
2 answers
How do I automatically delete images in Django media file when I delete the objects in Admin?
please help!
I am using Django 3 and have a basic blog with a title, description and image for each entry.
In Django admin I can delete each blog post however, when I look in my media file in Atom all the images are still there and I have to…

the_end
- 67
- 9
2
votes
1 answer
Profile picture is not getting displayed in django template base html page
I am creating a taskToDo web application. Most of the html files under templates are extending base.html file which includes a navbar in which i want to show the user profile picture under navbar of base.html.
The profile picture is getting saved…

Dharmesh Singh
- 107
- 2
- 11
2
votes
3 answers
How to put static and media setting at the same time in Django
Hi i'm quite confuse on this, on how to put static and media in urlpatterns at the same time, I already understand that static is for css/javascript while media is for the user upload file, since then if I use the {% static '' %} in html…

kim nicole sabordo
- 108
- 1
- 11
2
votes
1 answer
Django - serve() got an unexpected keyword argument 'documuent_root'
im trying to set up media file path / images for DRF but its not working and i cant figure out why.
i get this error:
serve() got an unexpected keyword argument 'documuent_root'
I am on mac runing django 1.11 DRF w/ python 3.6.
I have moved the…

Cflux
- 1,423
- 3
- 19
- 39
2
votes
2 answers
Django FilePathField doesn't work with relative path
There is a model Language. Language objects creates Admin through Django-admin. They have to choose from dropdown menu appropriate flag file.
The problem is that there is not flag to choice when I deploy project.
Since static files are being…

Milano
- 18,048
- 37
- 153
- 353
2
votes
1 answer
Django not serving media files if I check for settings.DEBUG
This serves the media files correctly:
urlpatterns = [
...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
This doesn't serve the media files:
from django.conf import settings
from django.conf.urls.static import…

Alejandro Veintimilla
- 10,743
- 23
- 91
- 180
2
votes
0 answers
Using Amazon S3 with Heroku Django to store image uploads
I have a Django project deployed to Heroku. Locally, it works fine. However, there is a problem in production: the image files uploaded by the admin cannot be found and displayed.
The error message is:
Failed to load resource: the server responded…

user3025403
- 1,070
- 3
- 21
- 33
2
votes
1 answer
django template doesn't load image uploaded in ImageField properly
i know this question have been brought up a lot of times,but i have tried a lot of different things,not working add.i belive i might have forget to add something silly in my code,just cant figure out what.below is the code of my heading model:
class…

Ashish
- 409
- 1
- 9
- 24
2
votes
1 answer
Images not displaying in Django 1.8
In Django 1.8, I can upload images and they are saved on the path that they should, but when I add the path to template, the images are not displaying. I GET 200 http code for them in terminal server.
Here are the relevant parts in…

Jand
- 2,527
- 12
- 36
- 66
2
votes
1 answer
Uploading image from Imagefield in django
I am new to Django.I have the following code on my html file:
{% load staticfiles %}
{{file}}


chaitanya90
- 697
- 2
- 8
- 24
2
votes
1 answer
Apache django and static and media file serving
I have a django project that I finally managed to serve using apache. I wanted to be very simple so although my test server was serving /media and static, I didn't include them in my site.conf file. I wanted first to check if deployment works and…

Apostolos
- 7,763
- 17
- 80
- 150
2
votes
2 answers
Django file browser doesn't work
I have installed Django file browser and added grappelli and filebrowser to my installed apps. And did every thing said in documention but when I browse http://127.0.0.1:8000/admin/filebrowser/ I got 404 page not found error. What's the problem? I…

hamidfzm
- 4,595
- 8
- 48
- 80