Creating the official Django Polls app table of contents
Social Share:
Thursday, January 2, 2025 at 4:38 AM | 3 min read
Last modified on Saturday, July 4, 2026 at 4:31 PM
#fullstack development, #macOS, #django, #python3, #series, #tutorial

Photo by David Clode on unsplash.com
In this series, I follow the official Django Polls application tutorial. After refactoring an application which had been created over seven years ago, I thought the best way to become even more familiar with the Django documentation would be to follow their Django Polls tutorial and create a Django Polls application.
Series Table of Contents
- Creating the official Django Polls app Part 1: In this section, I create a directory to house my Django Polls application, check if I have Django installed, select my Python interpreter, install virtualenv with pip, create a virtual environment for Django Polls, activate and deactivate the virtual environment, install Django, upgrade Django, create a project in Django Polls, initialize Git, start up the Django development server, create an app called polls, write a first view, create a URLconf for the index view, and configure the global URL configuration.
- Creating the official Django Polls app Part 2: In this section, I set up the Django Polls database, explained/set LANGUAGE_CODE, USE_I18N, USE_THOUSAND_SEPARATOR, NUMBER_GROUPING, USE_TZ, and INSTALLED_APPS, created the polls models, activated the models, played with the API in the interactive Python shell, discussed the Django admin interface, created a superuser, started the development server, registered polls app in polls/admin.py, and discussed the Question form in the admin interface.
- Creating the official Django Polls app Part 3: In this section, I wrote my first Django app, discussed URL patterns, wrote more views in polls/views.py, wrote views that actually worked, re-wrote the index view, created a templates directory in the polls directory, implemented template namespacing, added Django code to index.html, updated the index view to use the new index.html template, implemented the render() shortcut, implemented raising a 404 error in the detail view, used get_object_or_404() in the detail view, discussed Model's manager in Django, discussed Manager names, used template tags in the templating engine system, removed the hardcoded URL in the template in polls/index.html, and namespaced my URL names.
- Creating the official Django Polls app Part 4: In this section, I added a minimal form to my polls.detail.html template, updated the function-based vote view, created a polls/results.html template, refactored my polls/urls.py to match the new generic views, and installed djLint to format my Django templates.
- Creating the official Django Polls app Part 5: In this section, I introduced automated testing. I discussed what automated testing is, why it's important to create tests, basic testing strategies, wrote my first test to identify a bug, fixed the bug, created more comprehensive tests for Question.recently_published(), tested a view, analyzed the tools available to me in testing, introduced the Django test client, improved my PollsIndexView, tested my new PollsIndexView, tested the PollsDetailView, and broke down the refactored PollsDetailView (which originally contained a bug I fixed).
- Creating the official Django Polls app Part 6: In this section, I added static files to my Django Polls application configured for local development.
- Creating the official Django Polls app Part 7: In this section, I customized the Question admin form, added Choice-related objects to the admin form, customized the admin change list, added search capability to the admin interface, customized the admin look and feel, and customized my project's templates.
- Creating the official Django Polls app Part 8: In this section, I installed the Django Debug Toolbar, configured the toolbar so it would appear in the browser when I ran my development server, learned that I can customize the toolbar, ran my Django Polls project in the browser to view the toolbar, introduced resources where I could access other third-party packages to use in my applications, and I provided next steps.