Questions tagged [django-media]

237 questions
0
votes
2 answers

Django: could not parse the remainder (media i.e. image)

I am developing a WebApp using Django.I m a newbie, I have this html file which contains image, i did go through this "link", but now i am getting an error as in parsing the Media Url. Could any let me know what is wrong? I have checked the…
Nagaraj Tantri
  • 5,172
  • 12
  • 54
  • 78
0
votes
2 answers

Django media files not loading

I have a users app, profile is a model created in its models.py.The image is present in /media/profile_pics/ but even after giving the full path in src it is not loading. I cannot figure out why.Adding the relevant files below. models.py from…
afsara_ben
  • 542
  • 1
  • 11
  • 30
0
votes
0 answers

How to fix showing an image through ImageField from a model object?

I'm creating a website for an e-sports team where I want the administrators to have the option in backoffice (django admin) to add their collaborating partners. The model is gonna have an image, a link and a description. I know this question is…
0
votes
2 answers

Cannot upload media files in Django production to external folder

I have an issue on my Django production server. When I try to upload images, they always go to the app/media/ folder. However I want them to be uploaded to /mnt/data. In the admin panel, when I upload the image, it is always uploading in the…
RC-
  • 163
  • 10
0
votes
1 answer

Cannot remove folders from django media root

I'm trying to delete the directory from MEDIA_ROOT with shutil. After I have processed the files in the MEDIA_ROOT, I just want to clean up the directory along with the files in it. But getting permission denied error while using shutil. The default…
Krish V
  • 486
  • 1
  • 5
  • 19
0
votes
1 answer

Django 1.3 - Simple media deployment

I having some real trouble getting django to play nice with my media setup. I am not using staticfiles since I am have no need for a CDN at this point of the project and I want to keep it simple. My folder structure looks like this: /static …
Hanpan
  • 10,013
  • 25
  • 77
  • 115
0
votes
1 answer

Django - share media files during development

I want developers to use the same development database while developing a Django project so I've created a remote server with Ubuntu 18.04, created Postgres database and allowed remote access. The problem is that there are missing pictures - media…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
1 answer

Django Media Directory HTTP 404 for Uploaded Images

My project structure is: - api/ - urls.py ... - avatars/ - 16701016.jpg - 16701019.jpg ... - frontend/ - static/ - frontend/ - templates/ - urls.py ... - website/ - settings.py - urls.py …
Chitholian
  • 432
  • 1
  • 10
  • 19
0
votes
1 answer

Media files are not loading properly in the template (HTML ). Static files / images are working correctly

Media files are not loading properly when pulling from database. Although, when inspecting page, source seems to be correct. I have preformed migrations, collectstatic. static files are loaded to the html file settings.py STATIC_URL =…
Dom
  • 1
  • 2
0
votes
0 answers

How to use user uploaded image in Django template?

My problem is I am unable to use images in templates that are uploaded by an admin with admin interface. I have configured my settings and URLs according to documentation. In browser inspect element it is showing Uploaded image…
user9730761
0
votes
1 answer

Incorrect path to save the file in Django

I am now getting the file from my front-end and I set my model like this. model.py class User(models.Model): name = models.CharField(max_length=50) image= models.FileField(upload_to='image/', default=None) intro=…
0
votes
0 answers

how to load media from another app django

I have two apps accounts and home in tutorial project. A user can create a post in home app and I'm able to render post(i.e images and post data) in home app. In accounts app I want to create a search page where not logged in user can search and…
0
votes
1 answer

media files aren't served to template in django

I trying to serve media files to the template but make them inaccessible from url, and the opposite is happening when i do: http://localhost:8000/media/210000002A.tif I get prompted to download the files so it is being served when accessing from…
0
votes
0 answers

From Django, serve PDF to browser with #page=[] setting in URL

I am stuck trying to pass a parameter to a PDF rendered in the browser from Django. I think I want to serve the pdf with #page=[page_num] appended to the url the browser sees it at. This is my attempt at doing this in urls.py (note that I'm still…
Atcrank
  • 439
  • 3
  • 11
0
votes
0 answers

how serve django media file in shared hosting?

im using django 1.11.4 and i want to serve django media file in a shared host my web server is apache i already set MEDIA_ROOT and MEDIA_URL and evreything is fine when Debug = True i alread try HelioHost wiki and Django serving media files (user…