27 - Basic Django Forms - Python & Django 3.2 Tutorial Series
HTML-код
- Опубликовано: 9 фев 2025
- 27 - Basic Django Forms - Python & Django 3.2 Tutorial Series
Try Django 3.2 is a series to teach you the fundamentals of creating web applications with Python & Django by building a real project step-by-step.
⦿ Playlist: • Try Django 3.2 - Pytho...
⦿ DigitalOcean $100 Promo: do.co/cfe-youtube
⦿ Code: github.com/cod...
⦿ Subscribe: cfe.sh/youtube
⦿ Setup Video for Python 3 & Django 3: • Install & Setup Python...
best django course on yt!
@11:03 - Absolutely, a freelancing course will be extremely useful.
public poll
quality content all the way through, loving the tutorial, loving Django!
if anyone get stuck in forms, don't worry it's normal
so, what to do now?
rewatch the video and write the code as the instructor wrote it keep working and rewatch the video until you get the same result that shown in the video, then search for each function you use (is_valid(), cleaned_data(), etc....) and understand the concept of this function (what the function do and what the function returns, when the function return False and when to return True as an example) this work with me
if you don't understand it from the 10th time, don't worry, it take me 3 days to understand this basic form
keep calm and work harder, that's the key
last tip: if stuck in this video more than one week, go directly to the next video you'll see a better way
No truer words have been spoken 😂😂
@@chiomaobiajulu4363 thank you very much because you remind me with this comment, five months ago I wrote this comment and now I am still studying django and deep diving in other harder concepts, we have to work hard everyday, this is the secret .
Thank you agian
@@maamounhajnajeeb209 you’re welcome. I’m also refreshing my knowledge in Django. I want to build a project soon using Django and react in the front end. So I’m about to learn react for real. Lastly, I’m looking at playing a little with Django rest framework (which sounds intimidating but I have to try 🙏🏽)
keep going@@chiomaobiajulu4363
11:20 I see that you created two class methods clean_data and clean. But I don't see where you called them and how those print commands are being executed.
When use is form.is_valid() in a view it calls the clean methods
@@CodingEntrepreneurs Thanks for answering this. I was getting confused about the exact same thing.
can someone explain why it actually works that way?
@@CodingEntrepreneurs is both clean_title & clean method will be called?
@@sastapts The clean_() method is called on a form subclass - where is replaced with the name of the form field attribute. This method does any cleaning that is specific to that particular attribute, unrelated to the type of field that it is.
Thanks
how does clean_title(), clean() having same way of calling the cleaned_data but still returning different values, clean_title() is only returning title, whereas clean is returning title, content, I had tried clean_content() to check with content only but it didn't work. Video at @12:04 please answer me. Thanks in advance....
How can you modify how the form looks? I cant seem to target the html tags in css because they dont have class names. So how do i make the forms look nicer?
Hey, I see that you are using render() after doing POST and I read on on Django Official Tut Part 4 and some answers on StackOverflow that we should return with HttpResponseRedirect.
Is there something I'm missing here? Also when I use render and refresh my page, the form gets submitted again.
probably why I got "The view articles.views.article_create_view didn't return an HttpResponse object. It returned None instead."
can anyone explain what is meant by cleaned cuz its too much unclear to me
Raw input = dirty
Django forms clean this data (preventing scripting attacks)
Cleaned data = savable or usable.
2:23 in {%if not created %} suddenly raise error with me unlike before I DON'T KNOW WHY !!!!
erorr is not null constrain failed
im super confused with this
Me too !! Seems pretty overwhelming