If you're running Django 5.0 onwards you need to write: in base.html: {% load static %} in settings.py: MEDIA_URL = 'media/' MEDIA_ROOT = ( BASE_DIR/'media' ) Do NOT put a comma after 'media' in MEDIA_ROOT
@Gamycodes11 ай бұрын
Good looking out!
@Mawuko-SenyoHayibor9 ай бұрын
thank you
@lasmenso6 жыл бұрын
django + vue tutorial would be the best for real. if you created a series like that i would be so motivated from you because your teaching style is the best ever. and I loved django and vue from the first time i used them.
@DuongTran-zh6td2 жыл бұрын
Should be able to find media at localhost:8000/media 1:30 Settings.py i. MEDIA_URL = '/media/' ii. MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 3:30 urlpattern +=......... 5:40 (models) thumb = ...............
@wisamkhalid56637 жыл бұрын
thanks... just a question if anyone can answer me i will grateful. i have a problem that default image is not selected automatically if i don't chose a file and that generates an error although I specified thumb=models.ImageField(default='default.png', blank=True)? I can see in the video around time 9:00 when he tried to chose an image in the admin page , the default image was not there(same problem that i have). did he manually chose default.png for each article and then he change it? if so what is the point of using default image property. I even tried downloading the project from git hub and run it. I tried removing one of the articles image and then checked and there was no default image(same result that I have?). the other thing when you leave an article without an image you will get an error because thumb has no image although we set the property to blank=True? any help will be highly appreciated.
@rishabhverma66194 жыл бұрын
The images are not showing in the URl. Even I followed the each line as copy cat....after failing twice but still the images. Are not showing even not the default one
@madusan17 жыл бұрын
Wondered if you are going to show a video upgrading your site to Django 2.0 ... Great videos! For instance django 2.0 uses 'path' where 'url' was used previously in the urls file...
@fisherpeyton28243 жыл бұрын
@Kyng Gregory Yup, been using flixzone for since november myself =)
@renatojobal51233 жыл бұрын
Really simple explanation. Thank you
@skalippanbalippan69727 жыл бұрын
Best django tutorial in the planet. you didn't lie about this
@yashv20004 жыл бұрын
Which keyboard you were using here!? It a catchy sound when you type..
@toctoc49649 ай бұрын
If you have an error "expected str, bytes or os.PathLike object, not list", go to the settings py file and check that you dont have square brackets around MEDIA_ROOT.
@HasoVids5 жыл бұрын
Awesome series. I came back to this lesson after i finished them all because i noticed front end uploads weren't working for me. Was always going to the default image. If i later go to admin i see there is no image uploaded.
@srinivasr55677 жыл бұрын
I watched your vue.js tutorials,those were really awesome.Thank you for making such tutorials,and can you make some tutorials for how to use vue.js along with Django.
@lasmenso6 жыл бұрын
we really need that bro. django + vue
@asylbekbekmurzaev60983 жыл бұрын
Thank you brother, you did a great job!
@malikbrahimi75044 жыл бұрын
What about private media that isn't statically served like that? I'm using Django as my backend with React and I only want the image to be accessible if it's "owner" is authenticated.
@mudasirhayat42502 жыл бұрын
can you share source code please?
@sort_to_see_hidden_comments3 жыл бұрын
Why you didn't specify pillow in the installed apps list of the setting file after installation? I'm confused because I thought this step is required
@taihatranduc86135 жыл бұрын
can I use it in production mode? A lot of website says that it only works in development mode
@djrenders6 жыл бұрын
some tutorial websites have dynamic number of images(screenshot of some implementation) and text body explaining those images...Each tutorial can require different number of images and text body...so how to achieve that?
@cuteness87804 жыл бұрын
Hey .. Good video ..any tutorial for image gallary from youtube
@johnjim3741 Жыл бұрын
Images not showing for me in 2023. I installed pillow. I dont know how to show the image. My configuration is correct but its showing the broken image and alt text. Can somebody please help
@hasifibrahim58464 жыл бұрын
hey please help me The current path, media/images2.jpg, didn't match any of these. pls give me a solution
@SantoPapaVaticano6 жыл бұрын
I need help, someone can help me, I am getting this error "expected str, bytes or os.PathLike object, not tuple", I dont know what I do :(
@AxmedShiimax6 жыл бұрын
Me too
@sreepriyaganapathy85556 жыл бұрын
@@AxmedShiimax Please remove the , in the end of the code in settings. if we put , it automatically takes as a tuple.
@menjaholmwettergren50585 жыл бұрын
Thanks I got the same error and your answer was the solution
@yatharthmanchanda8594 Жыл бұрын
idk why, but image is not visible on the webpage after doing the above steps. Can someone help?
@MagnumIsWild4 жыл бұрын
Can anyone explain to me how our upload is automatically going to the media folder is this something with Django that it automatically keeps the image files in the media folder or I'm am I not getting the logic here
@arpitgupta18767 жыл бұрын
Sir , I put the defaul image as 'default.png ' but the file i dumped was 'default.jpg' i have changed it and even migrated the changes but it remains default.png PLZ help
@sammy94534 жыл бұрын
you have to change the image for tuples which were present before changing the field. After changing the field new tuples will have the latest default image
@AbhishekKumar-mq1tt7 жыл бұрын
Thank u for this awesome video.
@gilbertus55 жыл бұрын
Hi THe Net Ninja, you know some way to hide or restrict access to the url '/ MEDIA /' files in Django
@msrbq5 жыл бұрын
You can maybe use staff_member_required function, but what is the point from that
@aXimo5 жыл бұрын
I'm stuck... I did everything as you (checked twice), and images are only server from the article folder, not from the root folder/media... I'm on 2.2.6.
@austinmurphy90745 жыл бұрын
are u saying when you go to /media/ u get an error? or are u saying ur pictures are not showing up. Make sure to add default.png also
@danielfurey30816 жыл бұрын
I kept getting "no such column: articles_article.thumb" when trying to load the articles page and the admin articles page. Even after I did makemigrations like Shaun pointed out. I was racking my brain on how the thumb object wouldn't work here. It turns out, maybe this is a difference in the versions of Django, you have to run "python manage.py migrate" as well. That got it to work for me. I don't remember Shaun saying you had to run anything other than makemigrations in the tutorial. So if you're getting that problem like I did, that's the fix.
@Alkanen6 жыл бұрын
He says just that at 8:10 in the movie. He even mistypes it first so he has to do it twice =)
@danielfurey30816 жыл бұрын
Ah, thanks so much. I must have missed that.
@Alkanen6 жыл бұрын
@@danielfurey3081 no worries, it happens. God knows I miss most of the details in anything I watch :D
@nadimhayat34124 жыл бұрын
The png files aren't displaying properly on the website. What should i do?
@rishabhverma66194 жыл бұрын
Have u got solnnn????
@SinghFlex6 жыл бұрын
Thank you Sir.Great tutorial but what if i want to upload a media file like mp4 etc and i want to display on my webpage how can we do that??
@afshananwarali94626 жыл бұрын
please share how did you upload videos to webpage? Is it possible simply by changing jpg or any image extension to mp4?
@sarthakpatelia98884 жыл бұрын
how to integrate youtube videos please let me know sir!!!
@OvaisDIYGarage6 жыл бұрын
in django 2 if anyone is facing TypeError: 'module' object is not callable. the fix is to add "from django.contrib.staticfiles.urls import staticfiles_urlpatterns, static" . Rather then from django.conf.urls import static
@hakanhalil54936 жыл бұрын
love you man
@OvaisDIYGarage6 жыл бұрын
Hakan Halil glad to hear it helped you :)
@SudhanshuKumar-jl8iw5 жыл бұрын
How can add video in django media
@ESWARAMOORTHYP-dq9ic4 жыл бұрын
Bro how to add multiple images to this.
@hasib4joy4 жыл бұрын
for python 3.8.2 with pycharm install the pillow with command given bellow. python -m pip install --upgrade pillow
@oorhood3 жыл бұрын
You're the best
@yexiu16877 жыл бұрын
pls help why cant i display the images this time...it just pure white..
@prabuparamashivam33646 жыл бұрын
exception value : table articles_article has no column named thumb
@sathvikswaminathan79335 жыл бұрын
Try deleting your migration files and then run the migration commands again
@vedprakash-bw2ms5 жыл бұрын
Image is appearing broken ?? And every time i select one image its copy with some extension is created.
@MaheshMV6665 жыл бұрын
You might be confused with url.py. We are adding the code in djangonautic/url.py. Not in articles/url.py.
@687r45dfg4 жыл бұрын
The Image Is Not Being Showed In Django 3
@687r45dfg4 жыл бұрын
@obet reyes can you give the last part is settings.py please
@687r45dfg4 жыл бұрын
@obet reyes fine it's working now. i forgot to add .url in sytax and the correct is{{ article.thumnail.url}} == Correct
@nickiminaj08824 жыл бұрын
can u help me guys? i can't output the img. i did everything like in this tutorial but nothing happened((
@nirajs.golhar76094 жыл бұрын
what is the problem in detail
@rishabhverma66194 жыл бұрын
Yes I got the same tooo
@rishabhverma66194 жыл бұрын
The images are not showing there even not the default one
@nickiminaj08824 жыл бұрын
@@rishabhverma6619 i solved it somehow but i can't remember sorry😔😔😔 it was 6months ago😔
@rishabhverma66194 жыл бұрын
Can u share the github repository or something like that?!??
@SURJEETSINGH-ms9iu5 жыл бұрын
thanks alot bro :)
@RizwanAli-bu5oy6 жыл бұрын
can anyone help me.. how to upload and store multiple images for a single record in database?
@jiechen38276 жыл бұрын
Hi, I am also looking for ways like this, did you solve this?
@michakwiatek50316 жыл бұрын
You can craete model to store only image with it's description etc. and then in your model where you want to have many images just add column: images = models.ManyToManyField('', models.on_delete=SET_NULL)
@ishikagarg52616 жыл бұрын
default image is not displaying . what to do ???
@garychan19676 жыл бұрын
Download default.png: github.com/iamshaunjp/django-playlist/tree/lesson-17/djangonautic/media. Place image in media folder (not the assets folder) for example: C:\Users\Gary\project\python\django-playlist\djangonautic\media
@rishabhverma66194 жыл бұрын
Helpppp
@bintangpratomo88794 жыл бұрын
github repository??
@NetNinja4 жыл бұрын
In the vid description!
@abhayraghuvanshi51997 жыл бұрын
Great man thanks, can you make a video of your setup tour :-p
@sntrdm7 жыл бұрын
thank you !
@CodeProps5 жыл бұрын
I ran out into trouble when I try to view my uploaded video/audio files in media url. Can someone help me solve this ? Here's the link to the question. stackoverflow.com/questions/59298331/error-in-django-when-i-play-uploaded-media-files-through-media-url
@bpospanov5 жыл бұрын
brilliant
@gururaj21994 жыл бұрын
I hope adding videos is the same
@rayansailani44654 жыл бұрын
So no one here has an error in installing Pillow??