{"id":83207,"date":"2021-07-23T09:00:07","date_gmt":"2021-07-23T03:30:07","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=83207"},"modified":"2026-06-03T15:54:03","modified_gmt":"2026-06-03T10:24:03","slug":"quiz-web-app-python-django","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/","title":{"rendered":"Create Quiz Web App with Python Django"},"content":{"rendered":"<p>Let&#8217;s develop our own Quiz App Project in Django and let others attempt and test their knowledge by giving the Quiz. You will also get the basic idea of Django Python framework and how to design the front-end part.<\/p>\n<h3>About Quiz App<\/h3>\n<p>Every one of us likes to attempt a Quiz and check our score at the end. Have you ever thought of building a quiz using some of the programming knowledge and which other people can also be able to play. If you have thought about this, you have come to the right place to learn to make a beautiful quiz on various topics.<\/p>\n<p>If you are new to Django then it is the perfect project for you all to do it and have practice. It will also improve your front-end skills and most importantly javascript, ajax, and jQuery which many people find it difficult to understand.<\/p>\n<h3>Django Quiz App Project<\/h3>\n<p>The objective of our project is to implement quiz having different topics using Python Django Framework. A good knowledge of Django and front-end skills is enough for the project.<\/p>\n<h3>Project Prerequisites<\/h3>\n<p>This Django Quiz App requires a good knowledge of html, css, javascript, jQuery, bootstrap, and offcourse Python Django Framework. Some basic knowledge of javascript, ajax, and jQuery is very important.<\/p>\n<h3>Download Django Quiz Project Code<\/h3>\n<p>Please download the source code of python django quiz app: <a href=\"https:\/\/drive.google.com\/file\/d\/1PVGejqX-zFURoY_cGzaoy9Lm_swA93wb\/view?usp=drive_link\"><strong>Django Quiz Project Code<\/strong><\/a><\/p>\n<h3>Project File Structure<\/h3>\n<p>First, let\u2019s check the steps to build the Quiz Project Python:<\/p>\n<p>1. First it is important to start the project in Django by using django-admin startproject command<br \/>\n2. Then creating an app inside our project by django-admin startapp command.<br \/>\n3. Create a folder for templates and add it to the settings.py file.<br \/>\n4. Similarly, create a static file and media file as per requirements and add it to the settings.py file.<br \/>\n5. Then you are good to go and start making the urls and views.<\/p>\n<p>Let\u2019s start.<\/p>\n<p>1. First of all we create a navigation bar in base.html of our project:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;nav class=\"navbar navbar-expand-lg navbar-dark bg-dark\"&gt;\r\n    &lt;div class=\"container-fluid\"&gt;\r\n      &lt;a class=\"navbar-brand\" href=\"\/\"&gt;&lt;span class=\"head1\"&gt;Tech&lt;\/span&gt; &lt;span class=\"head2\"&gt;Vidvan&lt;\/span&gt;&lt;\/a&gt;\r\n      &lt;button class=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\"&gt;\r\n        &lt;span class=\"navbar-toggler-icon\"&gt;&lt;\/span&gt;\r\n      &lt;\/button&gt;\r\n      &lt;div class=\"collapse navbar-collapse\" id=\"navbarSupportedContent\"&gt;\r\n          {% if user.is_authenticated %}\r\n          &lt;ul class=\"navbar-nav me-auto mb-2 mb-lg-0\"&gt;\r\n            &lt;li class=\"nav-item\"&gt;\r\n              &lt;a class=\"nav-link\" href=\"#\"&gt;Welcome {{request.user}}&lt;\/a&gt;\r\n            &lt;\/li&gt;\r\n            &lt;li class=\"nav-item\"&gt;\r\n                &lt;a class=\"nav-link\" href=\"\/logout\"&gt;Logout&lt;\/a&gt;\r\n              &lt;\/li&gt;\r\n              {% if user.is_superuser %}\r\n              &lt;li class=\"nav-item\"&gt;\r\n                &lt;a class=\"nav-link\" href=\"\/admin\"&gt;Admin&lt;\/a&gt;\r\n              &lt;\/li&gt;\r\n              {% endif %}\r\n          &lt;\/ul&gt;\r\n          {% else %}\r\n        &lt;ul class=\"navbar-nav me-auto mb-2 mb-lg-0\"&gt;\r\n          &lt;li class=\"nav-item\"&gt;\r\n            &lt;a class=\"nav-link\" href=\"\/signup\"&gt;Sign Up&lt;\/a&gt;\r\n          &lt;\/li&gt;\r\n          &lt;li class=\"nav-item\"&gt;\r\n            &lt;a class=\"nav-link\" href=\"\/login\"&gt;Login&lt;\/a&gt;\r\n          &lt;\/li&gt;\r\n        &lt;\/ul&gt;\r\n        {% endif %}\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/nav&gt;\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>You must have a basic knowledge of bootstrap. It is sometimes very important to use it. It is open source and free to use the code. There are various components which you can use from bootstrap. Here a navbar is used and designed as per our needs.<\/p>\n<p>{% if user.is_authenticated %}: It means that if the user is logged in then the sign up and login options won\u2019t be visible to the user and vice versa.<\/p>\n<p>{% if user.is_superuser %}: It means if the user is a super user or the admin then only that particular user will get an admin option where he can manage all the quizzes.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"> {% for i in quiz %}\r\n      &lt;div class=\"col-md-4\"&gt;\r\n        &lt;div class=\"card\" style=\"width: 21rem;\"&gt;\r\n          &lt;div class=\"card-body\"&gt;\r\n            &lt;h5 class=\"card-title\" style=\"text-align: center;\"&gt;{{i.name}}&lt;\/h5&gt;\r\n            &lt;br&gt;\r\n            &lt;p class=\"card-text\"&gt;{{i.desc}}&lt;\/p&gt;\r\n            &lt;br&gt;\r\n            &lt;button data-bs-target=\"#exampleModal\" data-bs-toggle=\"modal\" data-time=\"{{i.time}}\"\r\n              data-questions=\"{{i.number_of_questions}}\" data-name=\"{{i.name}}\" data-id=\"{{i.id}}\" id=\"btn\"\r\n              style=\"justify-content: center;\" class=\"attempt btn mr-2 modal-button\"&gt;&lt;i class=\"fas fa-link\"&gt;&lt;\/i&gt;Attempt\r\n              Quiz&lt;\/button&gt;\r\n          &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n      {% endfor %}\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>In this django project, we have used cards for displaying various quiz topics which the user can view and choose whichever topic the user wants to give a quiz on. In Django if you want to use a for loop then the syntax for using it is: {% for loop %} and where the for loop ends: {% endfor %}. By using this for loop we fetch the data from the database and display it in a loop.<\/p>\n<p>You don\u2019t have to worry about the quiz topics, if you want to add a new quiz for the users you can simply add it through the database and it will automatically get displayed on the screen. Only the admin that is the superuser can make changes in Quiz.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;style&gt;\r\n  .attempt {\r\n    --gradient: linear-gradient(to left top, #c724dd 10%, #aaaaaa 90%) !important;\r\n  }\r\n \r\n  body {\r\n    background: #111;\r\n  }\r\n \r\n  .card {\r\n    background: #222;\r\n    border: 1px solid #7a24dd;\r\n    color: rgba(250, 250, 250, 0.8);\r\n    margin-bottom: 3rem;\r\n  }\r\n \r\n  #btn {\r\n    border: 5px solid;\r\n    border-image-slice: 1;\r\n    background: var(--gradient) !important;\r\n    -webkit-background-clip: text !important;\r\n    -webkit-text-fill-color: transparent !important;\r\n    border-image-source: var(--gradient) !important;\r\n    text-decoration: none;\r\n    position: relative;\r\n    left: 80px;\r\n  }\r\n \r\n  .head1 {\r\n    color: #FBAD30;\r\n    font-size: 2rem;\r\n    font-weight: bold;\r\n    height: 50px;\r\n  }\r\n \r\n  .head2 {\r\n    color: #EF4926;\r\n    font-size: 2rem;\r\n    font-weight: bold;\r\n  }\r\n \r\n  #btn:hover,\r\n  #btn:focus {\r\n    background: var(--gradient) !important;\r\n    -webkit-background-clip: none !important;\r\n    -webkit-text-fill-color: #fff !important;\r\n    border: 5px solid #fff !important;\r\n    box-shadow: #222 1px 0 10px;\r\n    text-decoration: underline;\r\n  }\r\n \r\n  .logo {\r\n    position: relative;\r\n    bottom: 2rem;\r\n  }\r\n \r\n  .container-fluid {\r\n    height: 60px;\r\n  }\r\n&lt;\/style&gt;\r\n<\/pre>\n<p>This is the required css that are included in the first page.<\/p>\n<p><strong>Linear Gradient:<\/strong> You can basically use more than one color where ever you want to use it. Also, give the position of it and the amount of which color you want in percent.<\/p>\n<p><strong>Body:<\/strong> Inside body whatever we specify it will get applied to the whole body that is whole page. Here, we have given a color for the whole body.<\/p>\n<p><strong>Btn:hover and btn:focus:<\/strong> Whenever user take their cursor on any button having the above mentioned class it can change its styling. Here the color of the button gets changed and it gets a white border.<\/p>\n<p><strong>You can try giving your own styling as you like.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from django.db import models\r\nfrom django.contrib.auth.models import User\r\nimport random\r\n\r\nclass Quiz(models.Model):\r\n    name = models.CharField(max_length=50)\r\n    desc = models.CharField(max_length=500)    \r\n    number_of_questions = models.IntegerField(default=1)\r\n    time = models.IntegerField(help_text=\"Duration of the quiz in seconds\", default=\"1\")\r\n    \r\n    def __str__(self):\r\n        return self.name\r\n\r\n    def get_questions(self):\r\n        return self.question_set.all()\r\n    \r\nclass Question(models.Model):\r\n    content = models.CharField(max_length=200)\r\n    quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE)\r\n    \r\n    def __str__(self):\r\n        return self.content\r\n    \r\n    def get_answers(self):\r\n        return self.answer_set.all()\r\n    \r\n    \r\nclass Answer(models.Model):\r\n    content = models.CharField(max_length=200)\r\n    correct = models.BooleanField(default=False)\r\n    question = models.ForeignKey(Question, on_delete=models.CASCADE)\r\n    \r\n    def __str__(self):\r\n        return f\"question: {self.question.content}, answer: {self.content}, correct: {self.correct}\"\r\n    \r\nclass Marks_Of_User(models.Model):\r\n    quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE)\r\n    user = models.ForeignKey(User, on_delete=models.CASCADE)\r\n    score = models.FloatField()\r\n    \r\n    def __str__(self):\r\n        return str(self.quiz)\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>So here we have created 4 models or databases named Quiz, Question, Answer, and marks_of_user. In the Quiz model, the details related to the quiz is added like the name of the quiz etc. In the Question model as the quiz is the foreign key, it is possible to add a question with respect to the quiz we want.<\/p>\n<p>It is possible to add the options and tick the correct option. Similarly in the Answer model question is a foreign key all the options are saved with their Boolean values and with respect to the particular question. Finally, in the marks of the user model the name of the user, the user\u2019s marks, and the name of the quiz given by user is saved.<\/p>\n<h4>JavaScript and jQuery:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vaScript and jQuery:\r\n    document.addEventListener('DOMContentLoaded', () =&gt; {\r\n        const timeLeftDisplay = document.querySelector('#time-left');\r\n        const startbtn = document.querySelector('.start-button');\r\n        let timeLeft = {{ quiz.time }\r\n    } ;\r\n \r\n    function countDown() {\r\n        setInterval(function () {\r\n            if (timeLeft &lt;= 0) {\r\n                clearInterval(timeLeft = 0)\r\n            }\r\n            if (timeLeft == 0) {\r\n                $(\".ans\").attr(\"disabled\", true);\r\n            }\r\n            timeLeftDisplay.innerHTML = timeLeft\r\n            timeLeft--;\r\n        }, 1000)\r\n    }\r\n    startbtn.addEventListener('click', countDown)\r\n    });\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>The above code is required to display the count down time. To answer the quiz questions user will be getting some amount of time, if the user fails to answer the questions in the given amount of time then all the radio buttons that is the options will get disabled and the user will not be allowed to further answer the questions.<\/p>\n<h4>Function Countdown:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if (timeLeft &lt;= 0) {\r\n                clearInterval(timeLeft = 0)<\/pre>\n<p>This means that the timer should get stopped at zero and not go further in negative numbers.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if (timeLeft == 0) {\r\n                    $(\".ans\").attr(\"disabled\", true);<\/pre>\n<p>It means that whenever the timer will be equal to zero all the options will get disabled so that the user cannot answer the questions.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">timeLeftDisplay.innerHTML = timeLeft\r\n                timeLeft--;<\/pre>\n<p>It will display the time and after every second it will reduce it by one second.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const url = window.location.href\r\n   const quizBox = document.getElementById('quiz-box')\r\n   const resultBox = document.getElementById('result-box')\r\n   const totalScore = document.getElementById('total')\r\n\r\n   $.ajax({\r\n       type: 'GET',\r\n       url: `${url}data`,\r\n       success: function (response) {\r\n           const data = response.data\r\n           data.forEach(ele =&gt; {\r\n               for (const [question, answers] of Object.entries(ele)) {\r\n\r\n                   quizBox.innerHTML += `\r\n                   &lt;hr class=\"ques\" style=\"display:none\"&gt;\r\n                   &lt;div class=\"mb-2 ques\" style=\"display:none\"&gt;\r\n                       &lt;b&gt;${question}&lt;\/b&gt;\r\n                   &lt;\/div&gt;\r\n               `\r\n                   $('.start-button').click(function () {\r\n                       $(\".ques\").show();\r\n                   });\r\n                   answers.forEach(answer =&gt; {\r\n                       quizBox.innerHTML += `\r\n                       &lt;div&gt;\r\n                           &lt;input type=\"radio\" class=\"ans\" style=\"display:none\" id=\"${question}-${answer}\" name=\"${question}\" value=\"${answer}\"&gt;\r\n                           &lt;label for=\"${question}\" style=\"display:none\" class=\"answer\"&gt;${answer}&lt;\/label&gt;\r\n                       &lt;\/div&gt;\r\n                   `\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>Here nested for loop is used to display all the questions with their options. The first forEach loop displays the first question of the quiz and second forEach loop displays all the options of the particular quiz. This process continues till all the questions are displayed from the database.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">marks.forEach(res=&gt;{\r\n               const resDiv = document.createElement(\"div\")\r\n               for (const [question, resp] of Object.entries(res)){\r\n\r\n                   resDiv.innerHTML += question\r\n                   const cls = ['container', 'p-3', 'text-light', 'h6']\r\n                   resDiv.classList.add(...cls)\r\n\r\n                   if (resp=='not answered') {\r\n                       resDiv.innerHTML += '- not answered'\r\n                       resDiv.classList.add('bg-info')\r\n                   }\r\n                   else {\r\n                       const answer = resp['answered']\r\n                       const correct = resp['correct_answer']\r\n\r\n                       if (answer == correct) {\r\n                           resDiv.classList.add('bg-success')\r\n                           resDiv.innerHTML += ` answered: ${answer}`\r\n                       } else {\r\n                           resDiv.classList.add('bg-danger')\r\n                           resDiv.innerHTML += ` | correct answer: ${correct}`\r\n                           resDiv.innerHTML += ` | answered: ${answer}`\r\n                       }\r\n                   }\r\n               }\r\n               resultBox.append(resDiv)\r\n           })\r\n       },\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<p>This forEach loop displays all the answers and the final score of the user after clicking on submit.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if (resp=='not answered') {\r\n                  resDiv.innerHTML += '- not answered'\r\n                  resDiv.classList.add('bg-info')\r\n              }\r\n<\/pre>\n<p>If the user does not answer any of the question then that question will be displayed in blue color(bg-info) as not answered.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">if (answer == correct) {\r\n                           resDiv.classList.add('bg-success')\r\n                           resDiv.innerHTML += ` answered: ${answer}`\r\n                       } else {\r\n                           resDiv.classList.add('bg-danger')\r\n                           resDiv.innerHTML += ` | correct answer: ${correct}`\r\n                           resDiv.innerHTML += ` | answered: ${answer}`\r\n                       }\r\n                   }\r\n               }\r\n               resultBox.append(resDiv)\r\n           })\r\n       },\r\n<\/pre>\n<p>If the user\u2019s answer matches the correct answer, it will be displayed in green (bg-success). And if the answer doesn\u2019t match, then it gets displayed in red color(bg-danger) indicating a wrong answer and the correct answer will be printed besides the users answer.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$(document).ready(function () {\r\n \r\n    $('.start-button').click(function () {\r\n        $(\".start\").hide();\r\n        $(\"#button1\").show();\r\n    });\r\n    $(\"#button1\").click(function () {\r\n        $(\".total\").show();\r\n        $(\"#hide-time\").hide();\r\n    });\r\n});\r\n<\/pre>\n<p>Once the document is ready this jQuery will be ready to get executed. Basically, using the above code we show, hide or disable whatever we want when we click something.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$(\"#button1\").click(function () {\r\n         $(\".total\").show();\r\n         $(\"#hide-time\").hide();\r\n     });\r\n<\/pre>\n<p>When the submit button which has the id of \u201cbutton1\u201d is clicked the total marks having class \u201ctotal\u201d is shown on the screen and the timer having id of \u201chide-time\u201d is hidden.<\/p>\n<h3>Django Quiz Project Output:<\/h3>\n<p>First Page of the project with the navigation bar and the cards having topics of the quiz<\/p>\n<p><strong>When the user is not logged in:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-home-when-user-not-logged-in.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83676\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-home-when-user-not-logged-in.png\" alt=\"quiz home when user not logged in\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>When the user is logged in (the admin option is only visible to the admin that is the superuser):<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-home.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83677\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-home.png\" alt=\"quiz home\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>Login page:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/django-quiz-app-login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83678\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/django-quiz-app-login.png\" alt=\"django quiz app login\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p>After clicking on attempt quiz button a modal will get open where instructions of the quiz will be displayed:<\/p>\n<p><strong>If the user is not logged in, the user is not allowed to give the quiz:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/user-not-logged-in.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83679\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/user-not-logged-in.png\" alt=\"user not logged in\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>If the user is logged in:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-instructions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83680\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-instructions.png\" alt=\"quiz instructions\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>Then the quiz will get started so as the timer:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/django-quiz-app.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83681\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/django-quiz-app.png\" alt=\"django quiz app\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>After completing the quiz and clicking on the submit button the total score will be displayed:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-answers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83682\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/quiz-answers.png\" alt=\"quiz answers\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>Admin can add a new quiz:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/add-quiz.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83683\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/add-quiz.png\" alt=\"add quiz\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<p><strong>Add new Question and delete question:<\/strong><\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/add-quiz-question.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-83684\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/add-quiz-question.png\" alt=\"add quiz question\" width=\"1915\" height=\"947\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>With this Quiz App Project in Django, we have successfully developed the Quiz App. We have used front-end to design the pages and also back-end databases for storing and fetching data. Now I hope you all have a basic idea of Django and all the front-end designing tools.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s develop our own Quiz App Project in Django and let others attempt and test their knowledge by giving the Quiz. You will also get the basic idea of Django Python framework and how&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":83716,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3383],"tags":[3382,3879,3880,483],"class_list":["post-83207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-django","tag-django-project","tag-django-quiz-app","tag-python-django-quiz-app","tag-python-project"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Create Quiz Web App with Python Django - TechVidvan<\/title>\n<meta name=\"description\" content=\"Develop your own Quiz App Project in Django and let others attempt &amp; test their knowledge by giving the Quiz. Code is included for your help.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Quiz Web App with Python Django - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Develop your own Quiz App Project in Django and let others attempt &amp; test their knowledge by giving the Quiz. Code is included for your help.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-23T03:30:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T10:24:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Quiz Web App with Python Django - TechVidvan","description":"Develop your own Quiz App Project in Django and let others attempt & test their knowledge by giving the Quiz. Code is included for your help.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/","og_locale":"en_US","og_type":"article","og_title":"Create Quiz Web App with Python Django - TechVidvan","og_description":"Develop your own Quiz App Project in Django and let others attempt & test their knowledge by giving the Quiz. Code is included for your help.","og_url":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-23T03:30:07+00:00","article_modified_time":"2026-06-03T10:24:03+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Create Quiz Web App with Python Django","datePublished":"2021-07-23T03:30:07+00:00","dateModified":"2026-06-03T10:24:03+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/"},"wordCount":1337,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg","keywords":["Django Project","django quiz app","Python Django Quiz App","Python project"],"articleSection":["Django Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/","url":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/","name":"Create Quiz Web App with Python Django - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg","datePublished":"2021-07-23T03:30:07+00:00","dateModified":"2026-06-03T10:24:03+00:00","description":"Develop your own Quiz App Project in Django and let others attempt & test their knowledge by giving the Quiz. Code is included for your help.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/07\/create-quiz-web-application-django-python.jpg","width":1200,"height":628,"caption":"create quiz web application django python"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/quiz-web-app-python-django\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Create Quiz Web App with Python Django"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=83207"}],"version-history":[{"count":1,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83207\/revisions"}],"predecessor-version":[{"id":448146,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/83207\/revisions\/448146"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/83716"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=83207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=83207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=83207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}