Curso Django. Formularios III. Vídeo 23
Desarrollo de Formularios en Django
In this section, the focus is on limiting the number of characters in a form to prevent database search issues and server slowdowns. Additionally, creating a contact form is discussed.
Limiting Number of Characters in Form
- To limit character input, evaluate the length of user input in the search box within views.
- If input exceeds 20 characters, display an error message; otherwise, proceed with the search task.
Creating a Contact Form
- Steps include building the form in views and configuring the server to send emails.
- Create a new view named "contacto" to render an HTML file for the contact form.
Building Contact Form HTML
This part focuses on constructing the HTML for a contact form within Django.
Constructing Contact Form HTML
- Copy and modify an existing product search form for the contact form.
New Section
In this section, the speaker discusses setting up a form for an email template.
Setting Up Email Form
- The speaker copies a tag for an email template.
- Replaces "asunto" with "email" and "name" with "asunto name email."
New Section
This part focuses on creating a large text box for users to input messages in the form.
Creating Message Text Box
- A large text box is created for users to elaborate on their messages.
- The text area is defined with rows set to 15 and columns set to 45.
New Section
Here, the speaker adds a send button to the form and tests its functionality.
Adding Send Button
- The speaker adds a send button to the form.
- Tests the form by changing the URL to "contacto" and verifies that the contact form appears.
New Section
This section covers user interactions with the contact form and validation of input fields.
User Interaction and Validation
- Discusses user actions like entering subject, email, and message in the contact form.
- Mentions validating user inputs such as email addresses before submission.
New Section
The speaker addresses an error related to CSR token verification in the form.
Error Handling - CSR Token
- Resolves CSR token verification error by including necessary token information in the form.
New Section
Testing post method functionality in handling form submissions.
Testing Post Method
- Tests post method functionality by submitting the form and displaying a success message.
New Section
Implementing response messages based on request methods in Django views.
Response Messages Implementation
- Implements response messages based on request methods in Django views using conditional statements.
New Section
Further development of response handling logic based on request methods.
Refining Response Logic
New Section
In this section, the speaker discusses the content available on their virtual computer skills platform, specifically focusing on free courses and personalized tutoring options.
Content Available on the Platform
- The virtual academy offers free computer skills courses organized by categories for easy access.
- Users can find all the free courses uploaded on YouTube in the "Cursos Gratuitos" section.
- For those seeking assistance related to the courses, there is a dedicated section called "Cursos Offline."
Turn any video into a summary like this
YouTube links, meetings, lectures. With transcripts, search, and chat.