Questions tagged [django-media]

237 questions
2
votes
1 answer

django - can't see the uploaded media files from apache

I have two different directory for both media and static. And as I upload the files through the local server (localhost:8000), I can see the uploaded images both by the local server and the apache server. However, when I upload it with…
Robin
  • 5,366
  • 17
  • 57
  • 87
2
votes
1 answer

Django - Displaying video with jwplayer

I am currently trying to display a video on a website using jwplayer. The view for the page is def video(request): return render_to_response('video_player/video.html', context_instance=RequestContext(request) And the html template being…
2
votes
0 answers

Getting the contents of django-storages file for processing

When I was locally serving media and I needed to process a task getting the file contents was very straight-forward. However I just shifted over to django-storages and it's not a drop in replacement. Can someone provide me a method which will pull…
rh0dium
  • 6,811
  • 4
  • 46
  • 79
2
votes
1 answer

Why does Dajaxice and Dajax uses MEDIAL_URL?

In Dajaxice's installation documentation, it says to set DAJAXICE_MEDIA_PREFIX in settings.py. Later that value is retrieved in the urls.py. In Dajax's installation documentation (which is 2 years old), it says to load the static file like…
hobbes3
  • 28,078
  • 24
  • 87
  • 116
1
vote
1 answer

django thumbnail img url does not correctly rendered in html

This is HTML code piece that in my template: {%load thumbnail%} And in my settings.py MEDIA_URL="http://url.com/static/" And this is the…
Sencer H.
  • 1,201
  • 1
  • 13
  • 35
1
vote
1 answer

Django How to download files from file system?

I'm trying to make a link to a file path on a Windows server downloadable to the user after they click the file link. My app displays entries from a result of searching a ticket model. The results on the page include items like: Ticket number,…
1
vote
2 answers

Django hide media files link for certain people

I programmed a function where you can download a file from the media folder with the media files depending on the link. The problem is that if you change the path in the link you have access to all the media files and not just the ones you are…
FLYAX
  • 141
  • 12
1
vote
1 answer

Function(instance, filename)

I,m working with my first project in Django, And I have a model like that: def get_image_path(instance, filename): category_name_path = instance.category.category_name return f"{category_name_path}/{filename}" class Gallery(models.Model): …
Kamil
  • 15
  • 4
1
vote
2 answers

Django media file page not found

So, I'm trying to follow Django documentation about the static files and media files I have a clean Django installation and I want to add the media folder. What I've done? I've changed the urls.py inside the project (not the app) and the settings.py…
NicoCaldo
  • 1,171
  • 13
  • 25
1
vote
0 answers

The media folder is not created after saving the file in the database Django

I`m writing a site on Django and I faced a problem. I have a cv field in the database, in which users can store their resume, I did everything as stated in the documentation. Namely: Create FileField model in models.py class…
Dimaapp
  • 123
  • 1
  • 1
  • 7
1
vote
0 answers

Django-filer problem when retrieve uploaded image in Django admin interface or any http|s request

I'm a noob in Django framework, sorry for misunderstanding in some concepts. Currently, I'm trying to set up a Django app with django-filer. Django filer was installed commonly and migrations were done according to documentation. The installed apps…
CDRM
  • 23
  • 6
1
vote
1 answer

How to change media url in django while serving media files using apache2?

I have a website in production that serves media files properly. Media Setting in settings.py file : MEDIA_URL = 'media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') I have created a media folder inside my project where my all media are being…
Manoj Kamble
  • 620
  • 1
  • 4
  • 21
1
vote
1 answer

Django can't acces media files, 404 Page not found

I recently started to learn Django but I'm still struggeling with accessing media files. My settings.py file includes the following: STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/ My urls.py in the project…
David
  • 11
  • 1
1
vote
1 answer

Nginx responds 404 not found on Django media URL in preprod, dev ok

I have a quite standard Django application with a Vuejs frontend. I have different environments (preprod/dev) in which I have file upload/download features. For files, everything works fine because they are returned through standard API views in…
lbris
  • 1,068
  • 11
  • 34
1
vote
0 answers

Django media not loading. staticfiles works

Using Django, I've deployed my web app to http://159.223.177.51/. To login to see the images, use sof///stackoverflow123 I can see the custom fonts and CSS so I know static is working. However, none of the media files are showing. When I try to…
stelity
  • 33
  • 8