Broken image on my Django website | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Broken image on my Django website

I created a Django website, everything works fine on my local server except for the images, it doesn't display and appears to be broken. How can I correct this pls? Below is link to the project repository on my GitHub account. https://github.com/Chibest01/PyShop

14th Jun 2022, 2:15 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
12 Answers
+ 2
This? Image_url = models.Charfield(max_length-2083) I think you have to upload the images into the model to use the images. https://djangocentral.com/uploading-images-with-django/ https://www.javatpoint.com/django-image-upload
14th Jun 2022, 5:31 PM
Chris Coder
Chris Coder - avatar
+ 1
You're not really giving us any information to go off of besides the question. Do you have any code that deals with this image to share?
14th Jun 2022, 2:35 PM
Justice
Justice - avatar
+ 1
Put the link in the body of your question. chibuzor obiefuna
14th Jun 2022, 2:54 PM
Justice
Justice - avatar
0
Justice how do you want me.to share the code here, it's in a file on my desktop and you know it's a project not some small lines of code that I can easily copy and paste here.
14th Jun 2022, 2:47 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
0
chibuzor obiefuna Then how were you expecting to get an answer to your question? Also, you don't always have to show whole code files. You can show a snippet just incase there's a syntax error you are not seeing, or you can share your code through a public github repository. Otherwise, I do not understand how you expect to get help with code if you aren't showing the code in any form. That would be like asking the dentist for help with pain and expecting him to treat you without showing your teeth.
14th Jun 2022, 2:49 PM
Justice
Justice - avatar
0
Justice I have uploaded it to GitHub but haven't gotten any replies to the question, is there a way I can share the GitHub link here, I am a beginner that's why I am having issues with it.
14th Jun 2022, 2:52 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
0
@okay thank you
14th Jun 2022, 2:54 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
14th Jun 2022, 3:07 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
0
I looked in your project folder. I didn't find any images. 🤷 Where is the file that reference the images and where are the images stored?
14th Jun 2022, 4:52 PM
Chris Coder
Chris Coder - avatar
0
Chris Coder I added the image url through the admin page and it's referenced in my model. From the tutorials I was learning from there wasn't any separate file for image.
14th Jun 2022, 5:05 PM
chibuzor obiefuna
chibuzor obiefuna - avatar
0
Mirielle pls do you have any YouTube video recommendation to learn this?
15th Jun 2022, 11:21 AM
chibuzor obiefuna
chibuzor obiefuna - avatar
0
Chris Coder pls can you recommend a YouTube tutorial video on it.
15th Jun 2022, 11:21 AM
chibuzor obiefuna
chibuzor obiefuna - avatar