Questions tagged [django-media]
237 questions
0
votes
0 answers
Media directory in production not working
The media directory is working as expected in my local machine but when I push the code to Heruko or Cloud Foundry the media is not working.
How to rectify this issue?
urls.py
urlpatterns = [
url(r'^profile/$', view_profile,…

Mohamed Naveen
- 131
- 1
- 4
- 8
0
votes
1 answer
Django media file not serve in production but serving in development (localhost)?
Django media file serving in development but not on production. whatever image i am uploading through Django admin it serving on website on local host but when i live my site on digital ocean its no displaying. how to solve this issue can any one…

Aayush
- 1
0
votes
1 answer
How to deploy django with media files?
I am trying to find a simple solution to deploy a django rest api which uses media files which are added via the admin panel. The rest api will be receiving very low traffic and so the simplest cheapest option is preferable.
Currently, I am using…

Tom Finet
- 2,056
- 6
- 30
- 54
0
votes
1 answer
Django1.11 - Show media on localhost
I'm having hard time to display media on local system.. the problem is that:
{{ producer.img.url }}
gives me a url path relative to the page I'm browsing, so it always fails to locate the file. It actually prints something…

davideghz
- 3,596
- 5
- 26
- 50
0
votes
1 answer
Django - acces image from image field in the template
What I have done:
in models.py:
class Image(models.Model):
img = models.ImageField(blank=True, Null=True)
And now I want to acces the image in the template. I tried it, but it didn't work: (myimg is an instance of Image.)

Asqiir
- 607
- 1
- 8
- 23
0
votes
2 answers
Media files not showing on Debug False
I've just deployed a site with pythonanywhere, when I set to DEBUG mode to False, my media images dissapear, the path of my media folder is not found. I was asking myself what causes this issue and how I can resolve it ?
Here is how I configured my…

Horai Nuri
- 5,358
- 16
- 75
- 127
0
votes
1 answer
Static and media urls in Django
In my settings file there is STATIC_URL = '/static/' and getting access to static files(css files) from the directory app/static/css/filename . If I add this to the setting file
MEDIA_URL = '/media/' is it possible to access the media files from…

Self
- 497
- 1
- 6
- 19
0
votes
0 answers
Set Content-Disposition header to media file
I work on an application that store media file on amazon S3. When I store them I rename it with a unique id but I would like to serve them with their original name. To rename files on download, amazon S3 let you set Content-Disposition header when…

user2347482
- 33
- 5
0
votes
1 answer
Python / Django - problems with serving media files (which do not appear in the folder)
Trying to add media files via admin.py, they do not appear in the folder they are supposed to be. Here is my code:
settings.py
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static_in_dev', 'media_root')
As far as I…

Moveton
- 253
- 2
- 12
0
votes
0 answers
Django Media files handling
I have set:
MEDIA_URL='/media/'
MEDIAFILES_DIRS = [os.path.join(BASE_DIR, "media_in_pro")]
I have a directory media_in_pro in base directory of project and within this i have directory called "profile" like "media_in_pro/profile/image.jpeg". I have…

user2719152
- 939
- 3
- 11
- 20
0
votes
2 answers
Django - different media for different templates
I would like to know how to properly attach a media files (css / js) for different subpages.
I have a dilemma between:
Using {% block %}{% endblock %} in template files. Or…

user3041764
- 817
- 10
- 35
0
votes
1 answer
Image does not get rendered in Django
I fiddled around with the django ImageField,
and I got following models for example
class Card(models.Model):
name = models.TextField()
mana = models.IntegerField()
rarity = …

Foo Bar
- 147
- 2
- 10
0
votes
1 answer
Cannot get sorl-thumbnail to work with MEDIA_ROOT set
From the moment I defined my MEDIA_ROOT in my settings.py I could not get sorl-thumbnail to generate the cache folder with images. Before that, I did not set MEDIA_ROOT in and it was working just fine.
Please note that I am in test with…

Q Caron
- 952
- 13
- 26
0
votes
0 answers
Django uwsgi Nginx not serving media files
Edit: I've made some progress trouble shooting this issue. For an update on the situation, read the comments and view this post on…

SilentDev
- 20,997
- 28
- 111
- 214
0
votes
1 answer
Using admin uploaded images
In admin page I add some image to model Product. In my settings.py file i write this:
MEDIA_ROOT = os.path.abspath('media')
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
('static', os.path.abspath('static')),
)
Uploaded…

Andrew
- 423
- 1
- 6
- 16