{"id":115,"date":"2018-05-17T16:00:12","date_gmt":"2018-05-17T16:00:12","guid":{"rendered":"https:\/\/159.69.80.24\/blog\/debugging-python-applications-with-pdb\/"},"modified":"2025-09-11T17:23:18","modified_gmt":"2025-09-11T17:23:18","slug":"debugging-python-applications-with-pdb","status":"publish","type":"post","link":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/","title":{"rendered":"Python Debugging with the Pdb Module"},"content":{"rendered":"<p>Debugging isn\u2019t a new trick \u2013 most developers actively use it in their work. Of course, everyone has their own approach to debugging, but I\u2019ve seen too many specialists try to spot bugs using basic things like <code>print<\/code> instead of actual debugging tools. Or even if they did use a Python debugging tool, they only used a small set of features and didn\u2019t dig deeper into the wide range of opportunities good debuggers offer. And which could have saved those specialists a lot of time.<\/p>\n<p>By the way, the specialists of our <a href=\"https:\/\/djangostars.com\/services\/python-development\/\">Python software development company<\/a> really feel the benefits of this process when developing software projects. We would like to note that if you want to create a Python project, have a clear plan but need help with development, debugging, etc., you can always contact our team.<\/p>\n<h2>Common Uses of Pdb<\/h2>\n<p>Python debugger is a built-in source code tool for improving and supporting different debugging processes. The most common of them are:<\/p>\n<ul>\n<li><b>Using breakpoints.<\/b> Breakpoints are specific points in your code where a debugger pauses and waits for further commands. So you can analyze the current state of the code even if it\u2019s not completed yet.<\/li>\n<li><b>Stepping through code.<\/b> The debugger allows you to execute your code line by line if needed. Using the pdb module makes it possible to check all functions and methods one after another.<\/li>\n<li><b>Displaying variables.<\/b> The p (print) command allows you to print the value of variables in a particular piece of code. It helps to deeply understand how the code is executed right in the middle of the process.<\/li>\n<\/ul>\n<p>Python debugger significantly eases the process of correcting errors and inaccuracies. Django Stars\u2019s team always uses pdb when developing projects in Python \u2014 this helps us to design high-quality products that work flawlessly.<\/p>\n<h2>Debugging Python with the Print Command<\/h2>\n<p>As mentioned above, some of us use \u2018print\u2019 to display information that reveals what\u2019s going on inside the code. Some of us use a logger for the same purpose \u2013 but please don\u2019t confuse this with the logger for the production code, as I\u2019m referring to developers that only add the logger during the problem searching period, i.e. just until the developing process ends.<\/p>\n<p>But the truth is, <code>print<\/code> has a lot of loopholes. Probably, its biggest drawback is that you have to add changes to your code, then re-run the Python application to see the different variable you\u2019re writing, or the current variable type, for example. So how is a debugger better?<\/p>\n<h2>Debugging Python with a Debugger<\/h2>\n<p>Essentially, a debugger for Python is a tool that gives you a way to, let\u2019s say, open up the application in a certain spot so you can have a look at your variables, call stack, or whatever you need to see, set conditional breakpoints, step through the source code line by line, etc. It\u2019s like opening the hood of your car to see where the smoke is coming from, searching part by part to identify the problem.<\/p>\n<p>If you\u2019re working with Python, not only can you look through the code during debugging, but you can also run the code that\u2019s written in the command line or even affect the process by changing the variables\u2019 value.<\/p>\n<p>Python has a built-in debugger called PDB. It\u2019s a simple utility with a command line interface that does the main job. It has all the debugger features you\u2019ll need, but if you\u2019re looking to pimp it up a little, you can extend it using IPDB module, which will provide the debugger with features from IPython.<\/p>\n<h2>Python Debugger (Pdb) Commands<\/h2>\n<p>The easiest way to use a Python debugger (PDB) is to call it in the code you\u2019re working on. Let&#8217;s look at a small tutorial on Python PDB.<\/p>\n<pre><code class=\"language-python\">import pdb; pdb.set_trace()\r\n<\/code><\/pre>\n<p>As soon as the interpreter reaches this line, you\u2019ll receive a command prompt on the terminal where you\u2019re running the program. This is a general Python prompt, but with some new commands.<\/p>\n<p><em>list(l)<\/em><\/p>\n<p>The list(l) command will show you the code line the Python interpreter is currently on. If you want to check a different area of the code, this command has arguments for the first and the last lines to show. If you provide only the number of the first line, you\u2019ll get to see the code around the line you\u2019ve given.<\/p>\n<p><em>up(p) and down(d)<\/em><\/p>\n<p>Up(p) and down(d) are the two commands needed to navigate through the call stack. With the help of these commands, you can see who is calling the current function, for example, or why the interpreter is going this way.<\/p>\n<p><em>step(s) and next(n)<\/em><\/p>\n<p>Another important pair of commands, step(s) and next(n), help you continue the execution of the application line by line. The only difference between these two is that next(n) will only go to the next line of the current function, even if it has a call for another function, but step(s) will go deeper in a case like this.<\/p>\n<p><em>break(b)<\/em><\/p>\n<p>The break(b) command allows you to set up new breakpoints without changing the code. It requires a bit more explaining, so I\u2019ll go into detail below.<\/p>\n<p>Here\u2019s a short overview of other <code>pdb<\/code> commands:<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-504\" src=\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2018\/12\/Img-1-2x-2-1.png\" alt=\"debugging img\" width=\"1600\" height=\"1528\" \/><\/p>\n<h2>Python Debugger In Advance<\/h2>\n<p>Previously, code changes were necessary to print something or set a breakpoint. However, quite often you need to set the breakpoint inside a third-party package. Of course, you can open the source code of a library at any time from your virtual environment and add a call for a Python debugger (PDB).<\/p>\n<p>But now you can run the application from the debugger and set breakpoints without any changes in the source code. To execute the application with the debugger, use the command <code>python -m pdb &lt;python script&gt;<\/code>.<\/p>\n<p>Let me show you an example. I have this simple application that tracks my working time. Inside it, I use the <code>requests<\/code> library to make HTTP requests, and I want to break on a post request. How do I do this? I run my application with the debugger and set a breakpoint inside the <code>requests<\/code> library.<\/p>\n<pre><code>$ python -m pdb run.py\r\n&gt; \/Users\/...........................\/run.py(1)&lt;module&gt;()\r\n-&gt; from TimeLog.app import run_app\r\n(Pdb) b requests\/sessions.py:555\r\nBreakpoint 1 at \/....................\/lib\/python3.6\/site-packages\/requests\/sessions.py:555\r\n(Pdb) c\r\n<\/code><\/pre>\n<p>As you can see, you don&#8217;t need to enter the full path to the source file. You just put a relative path from any folder in <code>sys.path<\/code>, the same way you would make an import into your code.<\/p>\n<p>Now it\u2019s easier to set the breakpoint. There\u2019s no need to put it somewhere in your own code and go step-by-step to the function you need, or to find the library source file and change it.<\/p>\n<p>But what if the application does a lot of calls, and you need one particular call? Easy. You can specify a breakpoint condition, and the debugger will break the application only if this condition will be considered True.<\/p>\n<p>In this example, the application will break only if <code>json<\/code> has a <code>time_entry<\/code> key.<\/p>\n<pre><code>python -m pdb run.py\r\n&gt; \/Users\/.....\/run.py(1)&lt;module&gt;()\r\n-&gt; from TimeLog.app import run_app\r\n(Pdb) b requests\/sessions.py:555, json is not None and 'time_entry' in json\r\nBreakpoint 1 at \/Users\/......\/lib\/python3.6\/site-packages\/requests\/sessions.py:555\r\n(Pdb) c\r\n<\/code><\/pre>\n<h2>Debug Helper for Django<\/h2>\n<p>If you\u2019re using the Django web framework, you probably know that if <code>DEBUG<\/code> is set to <code>True<\/code> in your settings, then on any exception you\u2019ll see a special page with information such as exception type and message, traceback, local variables, etc.<\/p>\n<p>If you want to enhance your debug page like this, install <a href=\"https:\/\/django-extensions.readthedocs.io\/en\/latest\/\" rel=\"nofollow\">django-extensions<\/a> and use the <code>runserver_plus<\/code> command to start your Django server for development. And in case you need to set up a debugger pin, here\u2019s an example of how you do it:<\/p>\n<p><code>WERKZEUG_DEBUG_PIN=1234 .\/manage.py runserver_plus<\/code><\/p>\n<p>If you use django-extensions instead of this default page, you\u2019ll get a traceback page where you can see the code for each and every line and an open debugger.<\/p>\n<p>The debugging in Python is carried out with the help of the <a href=\"https:\/\/werkzeug.palletsprojects.com\/en\/2.1.x\/\" rel=\"nofollow\">Werkzeug<\/a> project, which is a WSGI library for Python.<\/p>\n<p>As you can see, there are numerous ways to use a debugger. It\u2019s not too complicated, but at the same time, it will give you tons of advantages \u2013 not only will you earn a reputation as a kickass developer, but you\u2019ll also save yourself a lot of time and energy, and learn how to avoid different bugs in the future. And, of course, both the product and your client will win if you use a proper debugger. So, it\u2019s literally a win-win for everyone.<\/p>\n<p>The information in this tutorial is intended to introduce you to the Python and Django debugging process, the basic tools and commands for it, including <a href=\"https:\/\/djangostars.com\/blog\/asynchronous-programming-in-python-asyncio\/\">asynchronous programming Python<\/a> scenarios. However, with a serious project, it&#8217;s better to entrust programming tasks to an experienced development team. If this is your case, <a href=\"https:\/\/djangostars.com\/get-in-touch\/\">contact Django Stars<\/a>.<br \/>\n<div class=\"article-linking \">\n    <div class=\"article-linking-background\" style=\"background-image: url(https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2019\/05\/2_1_bg.png)\">\n\n    <\/div>\n    <div class=\"article-linking-content \">\n        <img decoding=\"async\" src=\"https:\/\/djangostars.com\/blog\/wp-content\/themes\/ds-new-blog\/assets\/img\/ds-logo-white.svg\" alt=\"logo\" class=\"article-linking-logo\">\n        <h3 class=\"article-linking-caption\">\n\t\t\t<u>Python &amp; Django<\/u> development\t\t\t                <p class=\"article-linking-caption--small\">\n                    Your chance to enter the market faster                <\/p>\n                    <\/h3>\n\t\t            <div class=\"article-link-wrapper\">\n                <a href=\"https:\/\/djangostars.com\/services\/python-django-development\/\" target=\"_blank\">Learn more<\/a>\n            <\/div>\n\t\t    <\/div>\n<\/div>\n<div class=\"dj-main-article-faq\" style=\"padding-top: 0px;\">\n\t\t<div class=\"dj-main-article-faq-title\">\n\t\tFrequently Asked Questions\n\t\t<\/div>\n\t\t<div class=\"dj-main-article-faq-items\">\n\t\t\t<div class=\"dj-main-article-faq-accordeon accordeon\"><dl>\n\t\t\t\t<dt>How do I run a PDB in Python? \n\t\t\t\t<div class=\"cross\">\n\t\t\t\t<span><\/span>\n\t\t\t\t<span><\/span>\n\t\t\t\t<\/div>\n\t\t\t\t<\/dt>\n\t\t\t\t<dd>The easiest way to use a Python debugger (PDB) is to call it in the code you\u2019re working on by adding <code>import pdb; pdb.set_trace()<\/code>. As soon as the interpreter reaches this line, you\u2019ll receive a command prompt on the terminal where you\u2019re running the program. It is a general Python prompt, but with some new commands.<\/dd>\n\t\t\t<\/dl><dl>\n\t\t\t\t<dt>How do you set a breakpoint in Python PDB? \n\t\t\t\t<div class=\"cross\">\n\t\t\t\t<span><\/span>\n\t\t\t\t<span><\/span>\n\t\t\t\t<\/div>\n\t\t\t\t<\/dt>\n\t\t\t\t<dd>The <code>break(b)<\/code> command allows you to set up new breakpoints without changing the code. You can use the command <code>python -m pdb <python script><\/code> to execute the application with the debugger and set breakpoints specifying breakpoint conditions if needed.<\/dd>\n\t\t\t<\/dl><dl>\n\t\t\t\t<dt>Does PDB come with Python? \n\t\t\t\t<div class=\"cross\">\n\t\t\t\t<span><\/span>\n\t\t\t\t<span><\/span>\n\t\t\t\t<\/div>\n\t\t\t\t<\/dt>\n\t\t\t\t<dd>PDB is a built-in Python debugger. It's a simple utility with a command line interface. It provides all the basic debugger features, but optionally you can extend it using IPDB module, which will provide the debugger with features from IPython.<\/dd>\n\t\t\t<\/dl><dl>\n\t\t\t\t<dt>When to use the Python PDB module? \n\t\t\t\t<div class=\"cross\">\n\t\t\t\t<span><\/span>\n\t\t\t\t<span><\/span>\n\t\t\t\t<\/div>\n\t\t\t\t<\/dt>\n\t\t\t\t<dd>You can use it when you need more options than the 'print' command provides to figure out what's going on inside the code \u2014 for example, when you don't want to change the source code. PDB gives you a way to, let's say, open up the application in a certain spot so you can have a look at your variables, call stack, or whatever you need to see, set conditional breakpoints, step through the source code line by line, etc.<\/dd>\n\t\t\t<\/dl><dl>\n\t\t\t\t<dt>What are the benefits of using Python PDB? \n\t\t\t\t<div class=\"cross\">\n\t\t\t\t<span><\/span>\n\t\t\t\t<span><\/span>\n\t\t\t\t<\/div>\n\t\t\t\t<\/dt>\n\t\t\t\t<dd>The built-in debugger is one of the significant advantages of Python. With PDB, not only can you look through the code during debugging, but also run the code written in the command line or even affect the process by changing the variables' value. In particular, it's easier to set breakpoints. There's no need to put them in the source code and go step-by-step to the function you need or to find the library source file and change it. Thus, PDB helps save development time.<\/dd>\n\t\t\t<\/dl><\/div>\n\t\t\t<\/div>\n\t\t<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Debugging isn\u2019t a new trick \u2013 most developers actively use it in their work. Of course, everyone has their own approach to debugging, but I\u2019ve seen too many specialists try to spot bugs using basic things like print instead of actual debugging tools. Or even if they did use a Python debugging tool, they only [&hellip;]<\/p>\n","protected":false},"author":35,"featured_media":3532,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[44],"tags":[30],"class_list":["post-115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-django","tag-backend"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Software Development Blog &amp; IT Tech Insights | Django Stars<\/title>\n<meta name=\"description\" content=\"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.\" \/>\n<link rel=\"canonical\" href=\"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts\/115\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging in Python With The Pdb Module | Django Stars\" \/>\n<meta property=\"og:description\" content=\"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\" \/>\n<meta property=\"og:site_name\" content=\"Software Development Blog &amp; IT Tech Insights | Django Stars\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/djangostars\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-17T16:00:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-11T17:23:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vadym Zakovinko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@djangostars\" \/>\n<meta name=\"twitter:site\" content=\"@djangostars\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vadym Zakovinko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\"},\"author\":{\"name\":\"Vadym Zakovinko\",\"@id\":\"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c\"},\"headline\":\"Python Debugging with the Pdb Module\",\"datePublished\":\"2018-05-17T16:00:12+00:00\",\"dateModified\":\"2025-09-11T17:23:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\"},\"wordCount\":1474,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg\",\"keywords\":[\"Backend\"],\"articleSection\":[\"Python &amp; Django\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\",\"url\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\",\"name\":\"Debugging in Python With The Pdb Module | Django Stars\",\"isPartOf\":{\"@id\":\"https:\/\/djangostars.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg\",\"datePublished\":\"2018-05-17T16:00:12+00:00\",\"dateModified\":\"2025-09-11T17:23:18+00:00\",\"author\":{\"@id\":\"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c\"},\"description\":\"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.\",\"breadcrumb\":{\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage\",\"url\":\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg\",\"contentUrl\":\"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg\",\"width\":1440,\"height\":620,\"caption\":\"Debugging-Python-Applications-with-pdb\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/djangostars.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Debugging with the Pdb Module\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/djangostars.com\/blog\/#website\",\"url\":\"https:\/\/djangostars.com\/blog\/\",\"name\":\"Software Development Blog &amp; IT Tech Insights | Django Stars\",\"description\":\"Welcome behind the scenes of software product development. We share our best practices, tech solutions, management tips, and every useful insight we\u2018ve got while working on our projects.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/djangostars.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c\",\"name\":\"Vadym Zakovinko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/djangostars.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8e92a3220157177135bd6024024dc94fa9509ecc7864ef5b8d2d5f9178527a6a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8e92a3220157177135bd6024024dc94fa9509ecc7864ef5b8d2d5f9178527a6a?s=96&d=mm&r=g\",\"caption\":\"Vadym Zakovinko\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/vadymzakovinko\/\"],\"url\":\"https:\/\/djangostars.com\/blog\/author\/vadym-zakovinko\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Software Development Blog &amp; IT Tech Insights | Django Stars","description":"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.","canonical":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts\/115","og_locale":"en_US","og_type":"article","og_title":"Debugging in Python With The Pdb Module | Django Stars","og_description":"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.","og_url":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/","og_site_name":"Software Development Blog &amp; IT Tech Insights | Django Stars","article_publisher":"https:\/\/www.facebook.com\/djangostars\/","article_published_time":"2018-05-17T16:00:12+00:00","article_modified_time":"2025-09-11T17:23:18+00:00","og_image":[{"width":1440,"height":620,"url":"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg","type":"image\/jpeg"}],"author":"Vadym Zakovinko","twitter_card":"summary_large_image","twitter_creator":"@djangostars","twitter_site":"@djangostars","twitter_misc":{"Written by":"Vadym Zakovinko","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#article","isPartOf":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/"},"author":{"name":"Vadym Zakovinko","@id":"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c"},"headline":"Python Debugging with the Pdb Module","datePublished":"2018-05-17T16:00:12+00:00","dateModified":"2025-09-11T17:23:18+00:00","mainEntityOfPage":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/"},"wordCount":1474,"commentCount":0,"image":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage"},"thumbnailUrl":"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg","keywords":["Backend"],"articleSection":["Python &amp; Django"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/","url":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/","name":"Debugging in Python With The Pdb Module | Django Stars","isPartOf":{"@id":"https:\/\/djangostars.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage"},"image":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage"},"thumbnailUrl":"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg","datePublished":"2018-05-17T16:00:12+00:00","dateModified":"2025-09-11T17:23:18+00:00","author":{"@id":"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c"},"description":"A Python debugger is actually a bag full of tricks \u2013 Django Stars share a simple way to efficiently debug products with a wide range of useful features.","breadcrumb":{"@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#primaryimage","url":"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg","contentUrl":"https:\/\/djangostars.com\/blog\/wp-content\/uploads\/2021\/12\/Debugging-Python-Applications-with-pdb.jpg","width":1440,"height":620,"caption":"Debugging-Python-Applications-with-pdb"},{"@type":"BreadcrumbList","@id":"https:\/\/djangostars.com\/blog\/debugging-python-applications-with-pdb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/djangostars.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Debugging with the Pdb Module"}]},{"@type":"WebSite","@id":"https:\/\/djangostars.com\/blog\/#website","url":"https:\/\/djangostars.com\/blog\/","name":"Software Development Blog &amp; IT Tech Insights | Django Stars","description":"Welcome behind the scenes of software product development. We share our best practices, tech solutions, management tips, and every useful insight we\u2018ve got while working on our projects.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/djangostars.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/djangostars.com\/blog\/#\/schema\/person\/07140b8befb0300bd391ef3756bf4d6c","name":"Vadym Zakovinko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/djangostars.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8e92a3220157177135bd6024024dc94fa9509ecc7864ef5b8d2d5f9178527a6a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8e92a3220157177135bd6024024dc94fa9509ecc7864ef5b8d2d5f9178527a6a?s=96&d=mm&r=g","caption":"Vadym Zakovinko"},"sameAs":["https:\/\/www.linkedin.com\/in\/vadymzakovinko\/"],"url":"https:\/\/djangostars.com\/blog\/author\/vadym-zakovinko\/"}]}},"_links":{"self":[{"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":22,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":9677,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/posts\/115\/revisions\/9677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/media\/3532"}],"wp:attachment":[{"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/djangostars.com\/blog\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}