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
33
votes
5 answers

Django {{ MEDIA_URL }} blank @DEPRECATED

I have banged my head over this for the last few hours. I can not get {{ MEDIA_URL }} to show up in settings.py .. MEDIA_URL = 'http://10.10.0.106/ame/' .. TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", …
Atherion
  • 584
  • 1
  • 5
  • 14
13
votes
1 answer

Django Media url returns 404 NOT FOUND

I have a django project. In order to set up my media url, I followed the django doc Django doc - Managing static files: For example, if your MEDIA_URL is defined as /media/, you can do this by adding the following snippet to your urls.py: from…
Larisa Bucur
  • 163
  • 1
  • 1
  • 5
7
votes
5 answers

Django: MEDIA_URL returns Page Not Found

settings.py # -*- coding: utf-8 -*- # Django settings for basic pinax project. import os.path import posixpath PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG # tells Pinax to serve media through the…
Sahat Yalkabov
  • 32,654
  • 43
  • 110
  • 175
6
votes
4 answers

Visualizing uploaded images in Django Admin

Although I've found useful posts on how to correctly display images in the Django-Admin (#1,#2,#3), I've so far not succeeded to follow the advices. As you can see below, the uploaded images are not being properly visualized and an 404 error is…
Tin
  • 1,006
  • 1
  • 15
  • 27
4
votes
1 answer

django: ImageField, MEDIA_ROOT, MEDIA_URL, how to set correctly

How should MEDIA_ROOT and MEDIA_URL be set correctly in context of ImageField? How should I set upload_to parameter for an ImageField? Comments for MEDIA_ROOT and MEDIA_URL are scarce, so I would like to know, what are they used for and how to set…
gruszczy
  • 40,948
  • 31
  • 128
  • 181
4
votes
5 answers

How can I use user uploaded files in my templates? (django)

So far I made it to the part where a user uploads an image but how can I use those images which are located in my media folder? Here is what I tried : my view: #I even tried to import MEDIA_ROOT to use it in my template... #from settings import…
Tony
  • 2,382
  • 7
  • 32
  • 51
3
votes
2 answers

[django]when debug=false,MEDIA_URL returns not found

when DEBUG=TRUE,media_url is working,but DEBUG = False ,returns not working. This is my setting file. setting.py DEBUG = False ... MEDIA_URL = "/pics/" MEDIA_ROOT = BASE_DIR urls.py urlpatterns = [ .... .... ] +…
kue
  • 33
  • 1
  • 4
3
votes
1 answer

Is the auto generated photologue image urls overridable?

I have two separate servers. One is hosting django instance on "www.example.com", the other is serving static files on "static.example.com". In django settings, MEDIA_URL points to "static.example.com". Therefore my photologue is using the…
Sencer H.
  • 1,201
  • 1
  • 13
  • 35
2
votes
1 answer

MEDIA_ROOT vs MEDIA_URL (Django)

I read the documentation about MEDIA_ROOT and MEDIA_URL then I could understand them a little bit but not much. MEDIA_ROOT: Absolute filesystem path to the directory that will hold user-uploaded files. MEDIA_URL: URL that handles the media served…
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
2
votes
1 answer

Smooth streaming player with Silverlight, is it possible to set the mediaurl to relative path?

Here is my code
sarsnake
  • 26,667
  • 58
  • 180
  • 286
1
vote
1 answer

how can restrict access to media image URL in django

how can restrict access to media image url , and make it accessible only by access owner user in django , here is my class model : class private_image(models.Model): i_user = models.OneToOneField(User, related_name='related_PRF_user',…
K.A
  • 1,399
  • 12
  • 24
1
vote
0 answers

Django : uploaded image not acessed in the template

I am trying to create a code like facebook image upload in django. My image gets uploaded and it is stored in the media folder under documents , and i like to show that image wherever i want in my template , but the image should be the latest one,…
kd007
  • 339
  • 1
  • 13
1
vote
1 answer

Fetching media by urls with Rest API

I would like to retrieve media inside statuses, but as I could read in the docs: For media in direct messages, media_url_https must be accessed via an authenticated twitter.com session or by signing a request with the user’s access token using…
Tunarock
  • 127
  • 1
  • 1
  • 12
1
vote
1 answer

Python Django media url not working after setting DEBUG = True

As stated in topic, my Django site media url is returning 404 after trying to access it. Everything was working flawless until I wanted to end the development process and set DEBUG = True in settings.py to have the site finished once and for all.…
Nhor
  • 3,860
  • 6
  • 28
  • 41
1
vote
2 answers

Django 1.6 image upload and media path

So I have a project on webfaction where I need to create two different environments, one to server django and one to server static files. So when I upload an image from admin panel I can see the image is placed in root i defined but with full path.…
user3482036
  • 109
  • 11
1
2 3