Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you please help me on the below project work - 1. Django - Exercise 4 - Add voting option The following are provided: Project

Could you please help me on the below project work -

image text in transcribedimage text in transcribedimage text in transcribed
1. Django - Exercise 4 - Add voting option The following are provided: Project - Exercise 4 with webpoll app, and its corresponding models. All necessary templates - home.html and question_detail.html. . All necessary imports for each built-in modules. . Question and Choice data. . Admin user account: User - frescoadmin Password - frescoadmin Create a polling (voting) option, and display the voting choice by doing the following steps: 1. In webpoll/templates/webpoll/question_detail.html, create a form with a post action method. . If the voting button is pressed without selecting any choice option, display an error message. To do this, use a template variable "error_message" and display it if the template receives the error message. Next, create a form with post action method and send it to the view by reversing the URL and passing the question_id as "(% url 'webpoll:vote' question. id *}"- . Provide secure form action by using "(% carf_token\f3. In webpoll.urls.py: Add the URL by using a route with a regular expression that takes any numeric parameter, and calls the view function "vote". Set the name parameter to "vote". Note: The numeric parameter can be passed as a named URL argument . Therefore, it can resolve to the ID of the question. Set the URL pattern, so that the URL */webpoll/1/vote * is valid. Note: To run migrations again, use the in-built command line option by clicking "New Terminal" (">_"), or by clicking "File" -> "New Terminal". To test, do the following: 1. Click Project -> Install (to install the necessary packages). 2. Click Project -> Run. 3. Click Project -> Test. 4. Click Preview App. Note: To check the functioning of the web page, use: /webpoll /webpoll/1 . /webpoll/1/vote . /webpoll/10 /webpoll/10/vote /admin 5. Click Submit Code and Continue (to submit the exercise)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

What are the various stages of a criminal trial? Describe each one.

Answered: 1 week ago