{"title":"Pisanie pierwszej aplikacji Django, część 8.","version":"4.2","locale":"pl","docname":"intro/tutorial08","url":"/pl/4.2/intro/tutorial08/","canonical":"https://djangodocs.dev/pl/4.2/intro/tutorial08/","summary":"Ten tutorial rozpoczyna się w miejscu, w którym zakończył się tutorial 7. Zbudowaliśmy naszą aplikację web-poll i teraz przyjrzymy się zewnętrznym pakietom.","html":"<h1>Pisanie pierwszej aplikacji Django, część 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>Ten tutorial rozpoczyna się w miejscu, w którym zakończył się <a class=\"reference internal\" href=\"/pl/4.2/intro/tutorial07/\"><span class=\"doc\">tutorial 7</span></a>. Zbudowaliśmy naszą aplikację web-poll i teraz przyjrzymy się zewnętrznym pakietom. Jedną z mocnych stron Django jest bogaty ekosystem zewnętrznych pakietów. Są to opracowane przez społeczność pakiety, które mogą być użyte do szybkiego ulepszenia zestawu funkcji aplikacji.</p>\n<p>Ten tutorial pokaże jak dodać <a class=\"reference external\" href=\"https://django-debug-toolbar.readthedocs.io\">Django Debug Toolbar</a>, powszechnie używany zewnętrzny pakiet. Django Debug Toolbar znalazł się w pierwszej trójce najczęściej używanych zewnętrznych pakietów w Django Developers Survey w ostatnich latach.</p>\n<aside class=\"admonition-where-to-get-help admonition\" role=\"note\">\n<p class=\"admonition-title\">Gdzie szukać pomocy:</p>\n<p>Jeśli masz trudności w przejściu tego tutorialu, przejdź do sekcji <a class=\"reference internal\" href=\"/pl/4.2/faq/help/\"><span class=\"doc\">Uzyskiwanie pomocy</span></a> często zadawanych pytań.</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=\"/pl/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 -m pip install 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=\"/pl/4.2/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> setting. Some packages\nneed other changes, like additions to your URLconf (<code class=\"docutils literal notranslate\">urls.py</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>Co dalej?<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>Tutorial dla początkujących kończy się tutaj. W międzyczasie możesz chcieć sprawdzić niektóre z kierunków wskazanych w <a class=\"reference internal\" href=\"/pl/4.2/intro/whatsnext/\"><span class=\"doc\">gdzie iść dalej</span></a>.</p>\n<p>Jeśli jesteś zaznajomiony z pakietowaniem w Pythonie i zainteresowany jak uczynić ankiety „aplikacją reusable”, sprawdź <a class=\"reference internal\" href=\"/pl/4.2/intro/reusable-apps/\"><span class=\"doc\">Zaawansowany tutorial: Jak pisać aplikacje do ponownego wykorzystania</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":"Co dalej?","anchor":"what-s-next","children":[]}],"breadcrumbs":[{"docname":"intro/index","title":"Pierwsze kroki","url":"/pl/4.2/intro/"}],"prev":{"docname":"intro/tutorial07","title":"Pisanie pierwszej aplikacji Django, część 7.","url":"/pl/4.2/intro/tutorial07/"},"next":{"docname":"intro/reusable-apps","title":"Zaawansowany tutorial: Jak pisać aplikacje wielokrotnego użytku","url":"/pl/4.2/intro/reusable-apps/"},"formats":{"html":"/pl/4.2/intro/tutorial08/","markdown":"/pl/4.2/intro/tutorial08.md","json":"/pl/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/pl/4.2/intro/tutorial08/","inVersions":["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"]}