{"title":"Writing your first Django app, part 8","version":"4.2","locale":"en","docname":"intro/tutorial08","url":"/en/4.2/intro/tutorial08/","canonical":"https://djangodocs.dev/en/4.2/intro/tutorial08/","summary":"This tutorial begins where Tutorial 7 left off. We’ve built our web-poll application and will now look at third-party packages. One of Django’s strengths is the…","html":"<h1>Writing your first Django app, part 8<a class=\"heading-anchor\" href=\"#writing-your-first-django-app-part-8\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>This tutorial begins where <a class=\"reference internal\" href=\"/en/4.2/intro/tutorial07/\"><span class=\"doc\">Tutorial 7</span></a> left off. We’ve\nbuilt our web-poll application and will now look at third-party packages. One of\nDjango’s strengths is the rich ecosystem of third-party packages. They’re\ncommunity developed packages that can be used to quickly improve the feature set\nof an application.</p>\n<p>This tutorial will show how to add <a class=\"reference external\" href=\"https://django-debug-toolbar.readthedocs.io\">Django Debug Toolbar</a>, a commonly used third-party\npackage. The Django Debug Toolbar has ranked in the top three most used\nthird-party packages in the Django Developers Survey in recent years.</p>\n<aside class=\"admonition-where-to-get-help admonition\">\n<p class=\"admonition-title\">Where to get help:</p>\n<p>If you’re having trouble going through this tutorial, please head over to\nthe <a class=\"reference internal\" href=\"/en/4.2/faq/help/\"><span class=\"doc\">Getting Help</span></a> section of the FAQ.</p>\n</aside>\n<section id=\"installing-django-debug-toolbar\">\n<h2>Installing Django Debug Toolbar<a class=\"heading-anchor\" href=\"#installing-django-debug-toolbar\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django Debug Toolbar is a useful tool for debugging Django web applications.\nIt’s a third-party package maintained by the <a class=\"reference external\" href=\"https://jazzband.co\">Jazzband</a> organization. The toolbar helps you understand how your\napplication functions and to identify problems. It does so by providing panels\nthat provide debug information about the current request and response.</p>\n<p>To install a third-party application like the toolbar, you need to install\nthe package by running the below command within an activated virtual\nenvironment. This is similar to our earlier step to <a class=\"reference internal\" href=\"/en/4.2/topics/install/#installing-official-release\"><span class=\"std std-ref\">install Django</span></a>.</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-0-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>python<span class=\"w\"> </span>-m<span class=\"w\"> </span>pip<span class=\"w\"> </span>install<span class=\"w\"> </span>django-debug-toolbar\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-0-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> py -m pip install django-debug-toolbar\n</code></pre></div></div></div>\n<p>Third-party packages that integrate with Django need some post-installation\nsetup to integrate them with your project. Often you will need to add the\npackage’s Django app to your <a class=\"reference internal\" href=\"/en/4.2/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></code></a> setting. Some packages\nneed other changes, like additions to your URLconf (<code class=\"docutils literal notranslate\"><span class=\"pre\">urls.py</span></code>).</p>\n<p>Django Debug Toolbar requires several setup steps. Follow them in <a class=\"reference external\" href=\"https://django-debug-toolbar.readthedocs.io/en/latest/installation.html\">its\ninstallation guide</a>.\nThe steps are not duplicated in this tutorial, because as a third-party\npackage, it may change separately to Django’s schedule.</p>\n<p>Once installed, you should be able to see the DjDT “handle” on the right side\nof the browser window when you refresh the polls application. Click it to open\nthe debug toolbar and use the tools in each panel. See the <a class=\"reference external\" href=\"https://django-debug-toolbar.readthedocs.io/en/latest/panels.html\">panels\ndocumentation page</a> for more\ninformation on what the panels show.</p>\n</section>\n<section id=\"getting-help-from-others\">\n<h2>Getting help from others<a class=\"heading-anchor\" href=\"#getting-help-from-others\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>At some point you will run into a problem, for example the\ntoolbar may not render. When this happens and you’re unable to\nresolve the issue yourself, there are options available to you.</p>\n<ol class=\"arabic simple\">\n<li><p>If the problem is with a specific package, check if there’s a\ntroubleshooting of FAQ in the package’s documentation. For example the\nDjango Debug Toolbar has a <a class=\"reference external\" href=\"https://django-debug-toolbar.readthedocs.io/en/latest/tips.html\">Tips section</a> that\noutlines troubleshooting options.</p></li>\n<li><p>Search for similar issues on the package’s issue tracker. Django Debug\nToolbar’s is <a class=\"reference external\" href=\"https://github.com/jazzband/django-debug-toolbar/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc\">on GitHub</a>.</p></li>\n<li><p>Consult the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a>.</p></li>\n<li><p>Join the <a class=\"reference external\" href=\"https://discord.gg/xcRH6mN4fa\">Django Discord server</a>.</p></li>\n<li><p>Join the #Django IRC channel on <a class=\"reference external\" href=\"https://libera.chat/\">Libera.chat</a>.</p></li>\n</ol>\n</section>\n<section id=\"installing-other-third-party-packages\">\n<h2>Installing other third-party packages<a class=\"heading-anchor\" href=\"#installing-other-third-party-packages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>There are many more third-party packages, which you can find using the\nfantastic Django resource, <a class=\"reference external\" href=\"https://djangopackages.org/\">Django Packages</a>.</p>\n<p>It can be difficult to know what third-party packages you should use. This\ndepends on your needs and goals. Sometimes it’s fine to use a package that’s\nin its alpha state. Other times, you need to know it’s production ready.\n<a class=\"reference external\" href=\"https://adamj.eu/tech/2021/11/04/the-well-maintained-test/\">Adam Johnson has a blog post</a> that outlines\na set of characteristics that qualifies a package as “well maintained”.\nDjango Packages shows data for some of these characteristics, such as when the\npackage was last updated.</p>\n<p>As Adam points out in his post, when the answer to one of the questions is\n“no”, that’s an opportunity to contribute.</p>\n</section>\n<section id=\"what-s-next\">\n<h2>What’s next?<a class=\"heading-anchor\" href=\"#what-s-next\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The beginner tutorial ends here. In the meantime, you might want to check out\nsome pointers on <a class=\"reference internal\" href=\"/en/4.2/intro/whatsnext/\"><span class=\"doc\">where to go from here</span></a>.</p>\n<p>If you are familiar with Python packaging and interested in learning how to\nturn polls into a “reusable app”, check out <a class=\"reference internal\" href=\"/en/4.2/intro/reusable-apps/\"><span class=\"doc\">Advanced tutorial: How to\nwrite reusable apps</span></a>.</p>\n</section>","rootId":"writing-your-first-django-app-part-8","toc":[{"title":"Installing Django Debug Toolbar","anchor":"installing-django-debug-toolbar","children":[]},{"title":"Getting help from others","anchor":"getting-help-from-others","children":[]},{"title":"Installing other third-party packages","anchor":"installing-other-third-party-packages","children":[]},{"title":"What’s next?","anchor":"what-s-next","children":[]}],"breadcrumbs":[{"docname":"intro/index","title":"Getting started","url":"/en/4.2/intro/"}],"prev":{"docname":"intro/tutorial07","title":"Writing your first Django app, part 7","url":"/en/4.2/intro/tutorial07/"},"next":{"docname":"intro/reusable-apps","title":"Advanced tutorial: How to write reusable apps","url":"/en/4.2/intro/reusable-apps/"},"formats":{"html":"/en/4.2/intro/tutorial08/","markdown":"/en/4.2/intro/tutorial08.md","json":"/en/4.2/intro/tutorial08.json"},"source":"https://github.com/django/django/blob/stable/4.2.x/docs/intro/tutorial08.txt","official":"https://docs.djangoproject.com/en/4.2/intro/tutorial08/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}