Questions tagged [django-media]

237 questions
0
votes
0 answers

problem in loading media files into templates

My django project is searching for images in /profile//myapp/profile_pics/images.jpg instead of myapp/profile_pics/images.jpg similar to this question image isn't uploaded to media root using Django settings.py - MEDIA_ROOT =…
user11700936
0
votes
1 answer

Django 3.0 MEDIA_ROOT and MEDIA_URL raise ImproperlyConfigured exception

I am developing a Django app where the users have profiles, and they can upload a profile picture, the pictures will be stored inside media/profile_pics/ and media is located in my root project's directory. I followed the Django docs [1]:…
be_noe
  • 25
  • 9
0
votes
1 answer

Can i serve media files on production server in Django?

Actually I created a fully functional web app using Django. I don't have much experience to host a Django web app on a production server. But I'm trying. My problem is that I read from a blog that we can't serve media files using Django. We need…
Maninder Singh
  • 425
  • 6
  • 14
0
votes
1 answer

django on heroku: celery worker gets 403 forbidden when accessing s3 media to read and process media files

I'm really stuck on this one because I'm not sure where to start: My Django project allows users to upload a spreadsheet and the app then processes and aggregates the uploaded data. The file is uploaded to the MEDIA_URL using a standard form and…
John
  • 949
  • 1
  • 9
  • 20
0
votes
1 answer

My form keep saying "This(image) field is required!" Django 3.0

I made a project with net-ninja on youtube now I am adding "uploading media" feature in my own project but it is not working although every thing is set just tell me where i m going wrong. My form is keep asking me to upload image file even though i…
0
votes
1 answer

Display uploaded images in HTML - DJANGO

I am trying to display images that are upload by the user in my HTML. I'd set the following: Settings: MEDIA_URL = '/media/' MEDIAFILES_DIRS = [] MEDIA_ROOT = os.path.join(BASE_DIR, "media") Upload files within the model to directory: class…
Rick
  • 211
  • 4
  • 11
0
votes
1 answer

Storing a image in Django file-system (without using a database)

index.html
{% csrf_token %} {{ image_form.as_p }}
forms.py class UploadImageForm(forms.Form): …
imharjyotbagga
  • 199
  • 4
  • 17
0
votes
1 answer

Failing To Display Media File Django

I have created a model called Product that takes in an ImageField that will be upload on a function I created: class Product(models.Model): title = models.CharField(max_length=120) description = models.TextField() price =…
user12514433
0
votes
2 answers

Trying to display multiple image for my product

I'm trying to display multiple images for one product but the images won't display and i don't know why can anyone help. My Models. I have to image field one is used to display and product and if the user wants more detail the other is used to show…
Eman5648
  • 83
  • 9
0
votes
0 answers

Django how to display saved media file name on custom input file?

I have made a form where user inputs personal information including a file. I want that whenever user opens his profile then he/she must be able to see already attached file name in custom input field or at least if he/she doesn't choose any new…
Maha Waqar
  • 585
  • 1
  • 10
  • 24
0
votes
0 answers

ImageFiled not working on update in django

I have a custom form to update record in Django. everything working fine except the image. updated = Brand.objects.filter(brand_id = brand_id).update(brand_name = brand_name, brand_slug = brand_slug, brand_logo_alt_text = brand_logo_alt_text,…
0
votes
2 answers

django/apache2 serving media isn't working on production

i'm running django mod_wsgi with apache2 on GCP VM instance and when i run it on DEBUG=False the static files work fine but media files is geting 404 when i check them while clearly the files are present on the server . my conf is based on the…
LeLouch
  • 601
  • 8
  • 21
0
votes
0 answers

How to serve media files with Django in local environment?

I have a problem when trying to display in a template a picture from my media file (for example a profil picture from an user). I have already looked at many topics, and everytime the answer is simply adding the line urlpatterns +=…
0
votes
1 answer

Unable to embed the image file in the template uploaded by user

I am trying to load the uploaded image in the template. The image is getting correctly uploaded and the url is also correct but I am still getting the 404 error. The error is:- GET…
0
votes
1 answer

How to download files from user_directory_path in django

I am trying to download files that were uploaded to my django media directory. I am able to upload the files successfully, but I don't know the best method of downloading back these files. I have seen different examples online but I don't fully…
Bruce
  • 103
  • 1
  • 8