Django Tutorial for Beginners - 33 - Upload Files

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

great video. went through some other tutorials on this and you were the first and only to go through each step comprehensibly and actually show the result. huge help, thanks.

MattressBros
Автор

for everyone that saying he can't follow the tutorial anymore go and learn html/javascript/bootstrap and come back and you will understand every thing that is going on :)

abodgamer
Автор

Update 2021:

You can use ImageField instead of FileField in models.
All other code remains the same.

Just install pillow additionally before making migrations by using terminal command:
"python -m pip install pillow".

Hope this helps!

rishabhgoyal
Автор

For those who can't see the image you should follow the next steps:
1) Erase all your previous Albums (From admin page or in the index.html)
2) In website > urls.py, add:
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL,
urlpatterns += static(settings.MEDIA_URL,
3) I just edit the detail.html file and add just:
<img src="{{ album.album_logo.url }}" class="img-responsive"/>
4) Finally, restart your server and load a new Album data.

I hope it works for you!

showizz
Автор

For those having a problem with loading files or with request.FILES['whatevername'] add to settings.py -> TEMPLATES -> 'context_processors:' [....]

IoVeMuSic
Автор

Man I love you, so many cool instructions and your way of expressing your thoughts is also amazing, keep going man, you're inspiring a lot of guys like me

tundoan
Автор

I was facing the problem of uploading the image so finally i solved the problem.
i forgot to write below line at submit button form.
enctype="multipart/form-data"

hankichanki
Автор

I read the book, from the django project.com and I prefer your tutorials

tundoan
Автор

For those whose images are not loading, make sure that the changes made in urls.py are in website/urls.py not in music/urls.py
Spent an hour figuring out...

sanskarjain
Автор

Me: Let's upload some files through Django.
Bucky: So I walked outside and my water spigot was on!

rockinsam
Автор

(6:47) - You're working in development mode but in production mode, how can we proceed ???

terangaplus
Автор

XD Your water running is awesome! Great tutorial btw.

treats
Автор

Guys if even after you have the save code your page does not load, do this "To access the MEDIA_URL in template you must add to your context_processeors inside the TEMPLATES config."

animecharacter
Автор

please help . u have not explained the detail page and index page.. i was following the video from 1st.. but after 29 everything i m lost .. please please help me.. please give me the link of the index page and detail page

IshwarKumarishwaraju
Автор

Why have you used FileField, not ImageField?

marekgorski
Автор

Oh right! Now I see what bucky do to his index.html! bwahahha took alot of pauses but I'm almost done haha

johnangelocuesta
Автор

use this in your urls.py file instead:

if settings.DEBUG:
urlpatterns += [ url(r'^media/(?P<path>.*)$', serve, { 'document_root': settings.MEDIA_ROOT, }), ]

and instead of importing "from django.conf.urls.static import static", do "import serve", like this:

from django.conf.urls.static import serve

ziyadmoustafa
Автор

*BUCKYYYY* please explain or upload the code bootstrap until video 29, cause in GitHub is the final one, we need only from cap 29, you changed (detail.html, index.html), THANKS! -.-!

HarryTeran
Автор

8:59 I wish I could debug my errors that fast!

raghuvamshakokkula
Автор

When the picture is not loading:
-> change {{ album.album_logo.url }} in index.html && detail.html

revoiceful