Questions tagged [media-url]

MEDIA_URL that handles the media served from MEDIA_ROOT

MEDIA_URL that handles the media served from MEDIA_ROOT which is part of

Django Docs: MEDIA_URL

32 questions
1
vote
2 answers

django - why is this not working?

i have this image field in my model foto = models.ImageField(upload_to="user/%Y/%m/%d",default='') and in my settings: MEDIA_ROOT = os.path.join(PROJECT_PATH, "media") MEDIA_URL = "/media/" and in my template:
doniyor
  • 36,596
  • 57
  • 175
  • 260
0
votes
2 answers

MEDIA_URL and redirect not working

I'm beginner in django, so started my test project. There is a home.html which gives options to register or login/logoff. Also I created a separate app registration for handling these requests. settings.py MEDIA_ROOT =…
John Eipe
  • 10,922
  • 24
  • 72
  • 114
0
votes
1 answer

How do i retrieve the media url in the storefront of my shopware theme?

I created a shopware theme with custom block and element in the admin panel, this element has both text and image, I am able to retrieve the configurations in the storefront, however, the image is returned as a mediaID ,how do i get the actual url…
0
votes
1 answer

How can I change URL for upladed files?

I have a problem with a path for opening files. I files are saved on s3 amazon, and url for it is https://certsstorenordic.s3.eu-west-3.amazonaws.com/certificate/2022/11/file name.pdf. It opens correct from Django admin. However when i am trying to…
0
votes
0 answers

Sending a pdf through WhatsApp Business API that is stored in google drive, but I am receiving an error " 12300 - Invalid Content-Type "

I am trying to send a pdf through WhatsApp Business API that is stored in google drive, but I am receiving an error " 12300 - Invalid Content-Type " can you help me where am I going wrong also, I want to know how to send a pdf in MediaUrl from my…
0
votes
1 answer

Why should you not use the MEDIA_ROOT and MEDIA_URL in the production level of Django?

I'm trying to find the answer for the name of the question that I posted, but I couldn't seem to find the answer. I've been looking at several tutorials in Django and they keep on telling me that you should not use the MEDIA_URL and MEDIA_ROOT type…
SihwanLee
  • 129
  • 1
  • 9
0
votes
1 answer

I cannot show my image in my django HTML template

I have this model: class MyModel(Model): other_field = CharField(max_length=200) image = ImageField(upload_to='images/', null=True, blank=True, ) I have this in my project settings file: MEDIA_URL = '/media/' # new MEDIA_ROOT =…
Amin Ba
  • 1,603
  • 1
  • 13
  • 38
0
votes
0 answers

I couldn't play the audios that were uploaded to admin (the urls have quotation marks)

I created a new class in my model.py file: class Audio(models.Model): ..... audio_object = models.FileField(default='') And I uploaded my audios to my admin page. However, the audios don't play and I right-clicked to a new browser, it shows…
Robin Li
  • 15
  • 4
0
votes
0 answers

Django MEDIA not serving despite configuration

I know this is a prevalent topic, but I still have yet to find a recent answer that helps. I have setup my dev environment to serve MEDIA in what I believe is the correct way, but images are still not resolving. Paths being return propery in…
0
votes
1 answer

Unable to display ImageField within Django template

I hope you can help me withmy Django project. I am able to upload an images under a media_cdn folder, inside a folder based on the name of the slug. The problem occurs when I try to display the image inside my post list and post. Can you please have…
IoanCosmin
  • 25
  • 11
0
votes
1 answer

Media Url not resolving properly

I have the media url and media root as follows. MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, MEDIA_URL) my urls.py is if settings.DEBUG: # static files (images, css, javascript, etc.) urlpatterns += static(settings.MEDIA_URL,…
Amarendra Reddy
  • 243
  • 2
  • 17
0
votes
2 answers

Upload imagefield Django

I need help please. I want to upload my images but there's a problem A screenshot of what I get I uploaded my images dynamically, In the model I have: .... class Visage(models.Model): personne = models.ForeignKey(Personne) def…
Lilia
  • 462
  • 6
  • 22
0
votes
1 answer

MEDIA_URL in class-based view

I'm not able to access MEDIA_URL in my class-based view. My understanding has been that I would create my view, and my context processor would provide it into my function-based view. Now I'm trying to switch to class-based, and I no longer have…
mitnosirrag
  • 163
  • 1
  • 8
0
votes
1 answer

MEDIA_URL path doesn't show up

I have a problem with my static and media settings, so my uploaded images doesn't show up on my site page. In my "settings.py" I have: MEDIA_ROOT = ( os.path.join(BASE_DIR, '..', 'static', 'media') ) MEDIA_URL = '/media/' STATIC_ROOT = ( …
s_spirit
  • 111
  • 10
0
votes
1 answer

set media url in sitecore 7.x

We have plugin for sitecore that allows content translation. When page is selected to be translated to different language new version of the target language is created and fields are updated with the translated content. We also translate images…
James
  • 75
  • 11