{"title":"How to manage error reporting","version":"5.0","locale":"el","docname":"howto/error-reporting","url":"/el/5.0/howto/error-reporting/","canonical":"https://djangodocs.dev/el/5.0/howto/error-reporting/","summary":"Όταν έχετε στον αέρα την ιστοσελίδα σας θα πρέπει να έχετε πάντα απενεργοποιημένη την επιλογή DEBUG, ήτοι να είναι False.","html":"<h1>How to manage error reporting<a class=\"heading-anchor\" href=\"#how-to-manage-error-reporting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>Όταν έχετε στον αέρα την ιστοσελίδα σας θα πρέπει να έχετε πάντα απενεργοποιημένη την επιλογή <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a>, ήτοι να είναι <code class=\"docutils literal notranslate\">False</code>. Αυτό θα κάνει τον server σας πιο γρήγορο και θα αποτρέψει τους κακόβουλους χρήστες να δουν λεπτομέρειες σχετικά με την εφαρμογή σας οι οποίες εμφανίζονται όταν προκύπτουν σφάλματα στη σελίδα.</p>\n<p>However, running with <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> set to <code class=\"docutils literal notranslate\">False</code> means you’ll never see\nerrors generated by your site – everyone will instead see your public error\npages. You need to keep track of errors that occur in deployed sites, so Django\ncan be configured to create reports with details about those errors.</p>\n<section id=\"email-reports\">\n<h2>Αναφορές email<a class=\"heading-anchor\" href=\"#email-reports\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"server-errors\">\n<h3>Σφάλματα server<a class=\"heading-anchor\" href=\"#server-errors\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>When <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">False</code>, Django will email the users listed in the\n<a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> setting whenever your code raises an unhandled exception and\nresults in an internal server error (strictly speaking, for any response with\nan HTTP status code of 500 or greater). This gives the administrators immediate\nnotification of any errors. The <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> will get a description of the\nerror, a complete Python traceback, and details about the HTTP request that\ncaused the error.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>Για να σταλεί το email, το Django απαιτεί μερικές ρυθμίσεις συνδεσιμότητας με τον δικό σας mail server. Θα πρέπει, τουλάχιστον, να προσδιορίσετε την επιλογή <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-EMAIL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST</code></a> και πιθανόν την <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-EMAIL_HOST_USER\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_USER</code></a> και <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-EMAIL_HOST_PASSWORD\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_PASSWORD</code></a>. Ωστόσο, ίσως χρειαστεί να προσδιορίσετε και άλλες επιλογές ανάλογα την παραμετροποίηση του mail server σας. Συμβουλευτείτε το <a class=\"reference internal\" href=\"/el/5.0/ref/settings/\"><span class=\"doc\">εγχειρίδιο γενικών ρυθμίσεων του Django</span></a> για μια πλήρη λίστα σχετικά με τις ρυθμίσεις του email.</p>\n</aside>\n<p>Από προεπιλογή, το Django θα στείλει email από τη διεύθυνση <a class=\"reference external\" href=\"mailto:root&#37;&#52;&#48;localhost\">root<span>&#64;</span>localhost</a>. Ωστόσο, κάποιοι πάροχοι ηλεκτρονικού ταχυδρομείου θα απορρίψουν όλα τα emails από αυτή τη διεύθυνση. Για να χρησιμοποιήσετε μια διαφορετική διεύθυνση αποστολέα, αλλάξτε τη ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-SERVER_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">SERVER_EMAIL</code></a>.</p>\n<p>Για να ενεργοποιήσετε αυτή τη συμπεριφορά, εισάγετε τις διευθύνσεις email των παραληπτών μέσα στη ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a>.</p>\n<aside class=\"admonition admonition-seealso\" role=\"note\">\n<p class=\"admonition-title\">Δείτε επίσης</p>\n<p>Για την αποστολή των emails που στέλνονται όταν προκύπτει σφάλμα στον server, χρησιμοποιείται το logging framework, οπότε μπορείτε να παραμετροποιήσετε αυτή τη συμπεριφορά <a class=\"reference internal\" href=\"/el/5.0/topics/logging/\"><span class=\"doc\">φέρνοντας στα μέτρα σας την παραμετροποίηση του logging</span></a>.</p>\n</aside>\n</section>\n<section id=\"errors\">\n<h3>Σφάλματα 404<a class=\"heading-anchor\" href=\"#errors\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Το Django μπορεί, επίσης, να παραμετροποιηθεί για να στέλνει email όταν προκύπτουν σπασμένοι σύνδεσμοι (broken links – σφάλμα 404 «page not found»). Το Django στέλνει emails σχετικά με σφάλματα 404 όταν:</p>\n<ul class=\"simple\">\n<li><p>Η ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> είναι <code class=\"docutils literal notranslate\">False</code> και</p></li>\n<li><p>Η ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a> περιέχει την <a class=\"reference internal\" href=\"/el/5.0/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware\" title=\"django.middleware.common.BrokenLinkEmailsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">django.middleware.common.BrokenLinkEmailsMiddleware</code></a>.</p></li>\n</ul>\n<p>If those conditions are met, Django will email the users listed in the\n<a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a> setting whenever your code raises a 404 and the request has\na referer. It doesn’t bother to email for 404s that don’t have a referer –\nthose are usually people typing in broken URLs or broken web bots. It also\nignores 404s when the referer is equal to the requested URL, since this\nbehavior is from broken web bots too.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p><a class=\"reference internal\" href=\"/el/5.0/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware\" title=\"django.middleware.common.BrokenLinkEmailsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">BrokenLinkEmailsMiddleware</code></a> must appear\nbefore other middleware that intercepts 404 errors, such as\n<a class=\"reference internal\" href=\"/el/5.0/ref/middleware/#django.middleware.locale.LocaleMiddleware\" title=\"django.middleware.locale.LocaleMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">LocaleMiddleware</code></a> or\n<a class=\"reference internal\" href=\"/el/5.0/ref/contrib/flatpages/#django.contrib.flatpages.middleware.FlatpageFallbackMiddleware\" title=\"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">FlatpageFallbackMiddleware</code></a>.\nPut it toward the top of your <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a> setting.</p>\n</aside>\n<p>Μπορείτε να ρυθμίσετε το Django να σταματήσει την αναφορά συγκεκριμένων σφαλμάτων 404 πειράζοντας την ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-IGNORABLE_404_URLS\"><code class=\"xref std std-setting docutils literal notranslate\">IGNORABLE_404_URLS</code></a>. Αυτή είναι μια λίστα από regular expression objects. Για παράδειγμα:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">import</span> <span class=\"nn\">re</span>\n\nIGNORABLE_404_URLS <span class=\"o\">=</span> <span class=\"p\">[</span>\n    re<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;\\.(php|cgi)$&quot;</span><span class=\"p\">),</span>\n    re<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^/phpmyadmin/&quot;</span><span class=\"p\">),</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>Σε αυτό το παράδειγμα, ένα σφάλμα 404 σε οποιοδήποτε URL που τελειώνει με <code class=\"docutils literal notranslate\">.php</code> ή <code class=\"docutils literal notranslate\">.cgi</code> <em>δεν</em> θα αναφερθεί. Ούτε, επίσης, οποιοδήποτε URL που ξεκινά με το <code class=\"docutils literal notranslate\">/phpmyadmin/</code>.</p>\n<p>Το ακόλουθο παράδειγμα δείχνει πως να εξαιρέσετε μερικά συμβατικά URLs τα οποία οι browsers και οι crawlers ζητούν συχνά:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">import</span> <span class=\"nn\">re</span>\n\nIGNORABLE_404_URLS <span class=\"o\">=</span> <span class=\"p\">[</span>\n    re<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^/apple-touch-icon.*\\.png$&quot;</span><span class=\"p\">),</span>\n    re<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^/favicon\\.ico$&quot;</span><span class=\"p\">),</span>\n    re<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;^/robots\\.txt$&quot;</span><span class=\"p\">),</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>(Σημειώστε ότι αυτά είναι regular expressions, οπότε βάζουμε ένα backslash μπροστά από τους χαρακτήρες της τελείας για να τις κάνουμε escape.)</p>\n<p>Αν θέλετε να αλλάξετε τη συμπεριφορά της middleware κλάσης <a class=\"reference internal\" href=\"/el/5.0/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware\" title=\"django.middleware.common.BrokenLinkEmailsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">django.middleware.common.BrokenLinkEmailsMiddleware</code></a> (πχ να αγνοήσει τα requests που προέρχονται από τους web crawlers), θα πρέπει να την κάνετε subclass, να παρακάμψετε (override) τις μεθόδους της και να χρησιμοποιήσετε τη δική σας στη ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a>.</p>\n<aside class=\"admonition admonition-seealso\" role=\"note\">\n<p class=\"admonition-title\">Δείτε επίσης</p>\n<p>Τα σφάλματα 404 γίνονται logged χρησιμοποιώντας το logging framework της Python. Από προεπιλογή, αυτά τα log αρχεία αγνοούνται, αλλά μπορείτε να τα χρησιμοποιήσετε για αναφορά σφαλμάτων γράφοντας έναν handler και <a class=\"reference internal\" href=\"/el/5.0/topics/logging/\"><span class=\"doc\">παραμετροποιώντας το logging</span></a> καταλλήλως.</p>\n</aside>\n</section>\n</section>\n<section id=\"filtering-error-reports\">\n<span id=\"id1\"></span><h2>Φιλτράροντας τις αναφορές σφαλμάτων<a class=\"heading-anchor\" href=\"#filtering-error-reports\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Προειδοποίηση</p>\n<p>Filtering sensitive data is a hard problem, and it’s nearly impossible to\nguarantee that sensitive data won’t leak into an error report. Therefore,\nerror reports should only be available to trusted team members and you\nshould avoid transmitting error reports unencrypted over the internet\n(such as through email).</p>\n</aside>\n<section id=\"filtering-sensitive-information\">\n<h3>Φιλτράροντας ευαίσθητα δεδομένα<a class=\"heading-anchor\" href=\"#filtering-sensitive-information\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Οι αναφορές σφαλμάτων είναι πολύ χρήσιμες για την αποσφαλμάτωση, οπότε είναι γενικά χρήσιμο να καταγράφετε όσο το δυνατόν περισσότερη πληροφορία σχετικά με αυτά τα λάθη γίνεται. Για παράδειγμα, από προεπιλογή, το Django καταγράφει το <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Stack_trace\">πλήρες traceback</a> για το exception που έγινε raised, κάθε τοπική μεταβλητή ενός <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Stack_frame\">traceback frame</a>’ και τα <a class=\"reference internal\" href=\"/el/5.0/ref/request-response/#httprequest-attributes\"><span class=\"std std-ref\">attributes</span></a> του <a class=\"reference internal\" href=\"/el/5.0/ref/request-response/#django.http.HttpRequest\" title=\"django.http.HttpRequest\"><code class=\"xref py py-class docutils literal notranslate\">HttpRequest</code></a>.</p>\n<p>Ωστόσο, μερικές φορές, μερικοί τύποι πληροφοριών μπορεί να είναι πολύ ευαίσθητοι και επομένως δεν πρέπει να καταγράφονται, για παράδειγμα το password ενός χρήστη ή ο αριθμός της πιστωτικής του κάρτας. Οπότε, εκτός από το φιλτράρισμα των ρυθμίσεων οι οποίες είναι ευαίσθητες, όπως περιγράφεται στο εγχειρίδιο του <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a>, το Django προσφέρει ένα σετ από decorator συναρτήσεις για να σας βοηθήσει να ελέγξετε ποιες πληροφορίες θα πρέπει να μένουν εκτός σε αναφορές σφαλμάτων σε ένα παραγωγικό περιβάλλον (ήτοι η ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> είναι <code class=\"docutils literal notranslate\">False</code>): η συνάρτηση <a class=\"reference internal\" href=\"#django.views.decorators.debug.sensitive_variables\" title=\"django.views.decorators.debug.sensitive_variables\"><code class=\"xref py py-func docutils literal notranslate\">sensitive_variables()</code></a> και η <a class=\"reference internal\" href=\"#django.views.decorators.debug.sensitive_post_parameters\" title=\"django.views.decorators.debug.sensitive_post_parameters\"><code class=\"xref py py-func docutils literal notranslate\">sensitive_post_parameters()</code></a>.</p>\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"django.views.decorators.debug.sensitive_variables\">\n<span class=\"sig-name descname\">sensitive_variables</span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span>variables</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.decorators.debug.sensitive_variables\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Αν μια συνάρτηση (είτε ένα view είτε κάποιο συνηθισμένο callback) μέσα στον κώδικα σας χρησιμοποιεί τοπικές μεταβλητές ικανές για να κρατήσουν ευαίσθητα δεδομένα, μπορείτε να εμποδίσετε τις τιμές των μεταβλητών αυτών να συμπεριληφθούν στις αναφορές σφαλμάτων, χρησιμοποιώντας τον decorator <code class=\"docutils literal notranslate\">sensitive_variables</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.views.decorators.debug</span> <span class=\"kn\">import</span> sensitive_variables\n\n\n<span class=\"nd\">@sensitive_variables</span><span class=\"p\">(</span><span class=\"s2\">&quot;user&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;pw&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;cc&quot;</span><span class=\"p\">)</span>\n<span class=\"k\">def</span> <span class=\"nf\">process_info</span><span class=\"p\">(</span>user<span class=\"p\">):</span>\n    pw <span class=\"o\">=</span> user<span class=\"o\">.</span>pass_word\n    cc <span class=\"o\">=</span> user<span class=\"o\">.</span>credit_card_number\n    name <span class=\"o\">=</span> user<span class=\"o\">.</span>name\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>In the above example, the values for the <code class=\"docutils literal notranslate\">user</code>, <code class=\"docutils literal notranslate\">pw</code> and <code class=\"docutils literal notranslate\">cc</code>\nvariables will be hidden and replaced with stars (<code class=\"docutils literal notranslate\">**********</code>)\nin the error reports, whereas the value of the <code class=\"docutils literal notranslate\">name</code> variable will be\ndisclosed.</p>\n<p>Αν θέλετε να κρύψετε όλες τις τοπικές μεταβλητές μια συνάρτησης από τις αναφορές σφαλμάτων, δεν έχετε παρά να μην δώσετε καμία παράμετρο στον decorator <code class=\"docutils literal notranslate\">sensitive_variables</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"nd\">@sensitive_variables</span><span class=\"p\">()</span>\n<span class=\"k\">def</span> <span class=\"nf\">my_function</span><span class=\"p\">():</span> <span class=\"o\">...</span>\n</code></pre></div>\n<aside class=\"admonition-when-using-multiple-decorators admonition\" role=\"note\">\n<p class=\"admonition-title\">Όταν χρησιμοποιείτε πολλούς decorators</p>\n<p>Αν η τιμή που θέλετε να αποκρύψετε είναι μια παράμετρος μιας συνάρτησης (πχ η “<code class=\"docutils literal notranslate\">user</code>’ στο παρακάτω παράδειγμα) και αν η διακοσμημένη συνάρτηση (συνάρτηση στην οποία έχει εφαρμοστεί ένας decorator) έχει πολλούς decorators, τότε σιγουρευτείτε ότι το <code class=\"docutils literal notranslate\">&#64;sensitive_variables</code> βρίσκεται στην κορυφή της αλυσίδας των decorators. Με αυτό τον τρόπο θα αποκρύψει, επίσης, την παράμετρο της συνάρτησης όσο αυτή περνάει στους επόμενους decorators, κάτω στην αλυσίδα:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"nd\">@sensitive_variables</span><span class=\"p\">(</span><span class=\"s2\">&quot;user&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;pw&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;cc&quot;</span><span class=\"p\">)</span>\n<span class=\"nd\">@some_decorator</span>\n<span class=\"nd\">@another_decorator</span>\n<span class=\"k\">def</span> <span class=\"nf\">process_info</span><span class=\"p\">(</span>user<span class=\"p\">):</span> <span class=\"o\">...</span>\n</code></pre></div>\n</aside>\n<aside class=\"version-note version-changed\" data-version=\"5.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 5.0</p><p>Support for wrapping <code class=\"docutils literal notranslate\">async</code> functions was added.</p>\n</aside>\n</dd></dl>\n\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"django.views.decorators.debug.sensitive_post_parameters\">\n<span class=\"sig-name descname\">sensitive_post_parameters</span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span>parameters</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.decorators.debug.sensitive_post_parameters\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Αν ένα από τα views σας, λαμβάνει ένα object τύπου <a class=\"reference internal\" href=\"/el/5.0/ref/request-response/#django.http.HttpRequest\" title=\"django.http.HttpRequest\"><code class=\"xref py py-class docutils literal notranslate\">HttpRequest</code></a> το οποίο έχει ικανές να αποθηκεύουν ευαίσθητα δεδομένα <a class=\"reference internal\" href=\"/el/5.0/ref/request-response/#django.http.HttpRequest.POST\" title=\"django.http.HttpRequest.POST\"><code class=\"xref py py-attr docutils literal notranslate\">παραμέτρους POST</code></a>, μπορείτε να αποτρέψετε τις τιμές αυτών των παραμέτρων να καταγραφούν στις αναφορές σφαλμάτων χρησιμοποιώντας τον decorator <code class=\"docutils literal notranslate\">sensitive_post_parameters</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.views.decorators.debug</span> <span class=\"kn\">import</span> sensitive_post_parameters\n\n\n<span class=\"nd\">@sensitive_post_parameters</span><span class=\"p\">(</span><span class=\"s2\">&quot;pass_word&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;credit_card_number&quot;</span><span class=\"p\">)</span>\n<span class=\"k\">def</span> <span class=\"nf\">record_user_profile</span><span class=\"p\">(</span>request<span class=\"p\">):</span>\n    UserProfile<span class=\"o\">.</span>create<span class=\"p\">(</span>\n        user<span class=\"o\">=</span>request<span class=\"o\">.</span>user<span class=\"p\">,</span>\n        password<span class=\"o\">=</span>request<span class=\"o\">.</span>POST<span class=\"p\">[</span><span class=\"s2\">&quot;pass_word&quot;</span><span class=\"p\">],</span>\n        credit_card<span class=\"o\">=</span>request<span class=\"o\">.</span>POST<span class=\"p\">[</span><span class=\"s2\">&quot;credit_card_number&quot;</span><span class=\"p\">],</span>\n        name<span class=\"o\">=</span>request<span class=\"o\">.</span>POST<span class=\"p\">[</span><span class=\"s2\">&quot;name&quot;</span><span class=\"p\">],</span>\n    <span class=\"p\">)</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>In the above example, the values for the <code class=\"docutils literal notranslate\">pass_word</code> and\n<code class=\"docutils literal notranslate\">credit_card_number</code> POST parameters will be hidden and replaced with\nstars (<code class=\"docutils literal notranslate\">**********</code>) in the request’s representation inside the\nerror reports, whereas the value of the <code class=\"docutils literal notranslate\">name</code> parameter will be\ndisclosed.</p>\n<p>Για να αποκρύψετε όλες τις POST παραμέτρους ενός request στις αναφορές σφαλμάτων, δεν έχετε παρά να μην περάσετε καμία παράμετρο στον decorator <code class=\"docutils literal notranslate\">sensitive_post_parameters</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"nd\">@sensitive_post_parameters</span><span class=\"p\">()</span>\n<span class=\"k\">def</span> <span class=\"nf\">my_view</span><span class=\"p\">(</span>request<span class=\"p\">):</span> <span class=\"o\">...</span>\n</code></pre></div>\n<p>Για συγκεκριμένα <a class=\"reference internal\" href=\"/el/5.0/topics/auth/default/#module-django.contrib.auth.views\" title=\"django.contrib.auth.views\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.auth.views</code></a> views (<code class=\"docutils literal notranslate\">login</code>, <code class=\"docutils literal notranslate\">password_reset_confirm</code>, <code class=\"docutils literal notranslate\">password_change</code> και <code class=\"docutils literal notranslate\">add_view</code>, <code class=\"docutils literal notranslate\">user_change_password</code> για το <code class=\"docutils literal notranslate\">auth</code> admin), όλες οι POST παράμετροι μένουν εκτός των αναφορών σφαλμάτων για να εμποδίσουν τυχόν διαρροές ευαίσθητων δεδομένων, όπως είναι τα passwords των χρηστών.</p>\n<aside class=\"version-note version-changed\" data-version=\"5.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 5.0</p><p>Support for wrapping <code class=\"docutils literal notranslate\">async</code> functions was added.</p>\n</aside>\n</dd></dl>\n\n</section>\n<section id=\"custom-error-reports\">\n<span id=\"id2\"></span><h3>Παραμετροποιήσιμες αναφορές σφαλμάτων<a class=\"heading-anchor\" href=\"#custom-error-reports\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>All <a class=\"reference internal\" href=\"#django.views.decorators.debug.sensitive_variables\" title=\"django.views.decorators.debug.sensitive_variables\"><code class=\"xref py py-func docutils literal notranslate\">sensitive_variables()</code></a> and <a class=\"reference internal\" href=\"#django.views.decorators.debug.sensitive_post_parameters\" title=\"django.views.decorators.debug.sensitive_post_parameters\"><code class=\"xref py py-func docutils literal notranslate\">sensitive_post_parameters()</code></a> do is,\nrespectively, annotate the decorated function with the names of sensitive\nvariables and annotate the <code class=\"docutils literal notranslate\">HttpRequest</code> object with the names of sensitive\nPOST parameters, so that this sensitive information can later be filtered out\nof reports when an error occurs. The actual filtering is done by Django’s\ndefault error reporter filter:\n<a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter\" title=\"django.views.debug.SafeExceptionReporterFilter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.SafeExceptionReporterFilter</code></a>. This filter uses the\ndecorators” annotations to replace the corresponding values with stars\n(<code class=\"docutils literal notranslate\">**********</code>) when the error reports are produced. If you wish to\noverride or customize this default behavior for your entire site, you need to\ndefine your own filter class and tell Django to use it via the\n<a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code></a> setting:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code>DEFAULT_EXCEPTION_REPORTER_FILTER <span class=\"o\">=</span> <span class=\"s2\">&quot;path.to.your.CustomExceptionReporterFilter&quot;</span>\n</code></pre></div>\n<p>Μπορείτε επίσης να ελέγξετε, σε πιο λεπτομερές επίπεδο, ποιο φίλτρο να χρησιμοποιηθεί μέσα σε κάθε view θέτοντας το attribute <code class=\"docutils literal notranslate\">exception_reporter_filter</code> του <code class=\"docutils literal notranslate\">HttpRequest</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"k\">def</span> <span class=\"nf\">my_view</span><span class=\"p\">(</span>request<span class=\"p\">):</span>\n    <span class=\"k\">if</span> request<span class=\"o\">.</span>user<span class=\"o\">.</span>is_authenticated<span class=\"p\">:</span>\n        request<span class=\"o\">.</span>exception_reporter_filter <span class=\"o\">=</span> CustomExceptionReporterFilter<span class=\"p\">()</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>Your custom filter class needs to inherit from\n<a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter\" title=\"django.views.debug.SafeExceptionReporterFilter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.SafeExceptionReporterFilter</code></a> and may override the\nfollowing attributes and methods:</p>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter\">\n<em class=\"property\"><span class=\"k\">class</span> </em><span class=\"sig-name descname\">SafeExceptionReporterFilter</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\">\n<span class=\"sig-name descname\">cleansed_substitute</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>The string value to replace sensitive value with. By default it\nreplaces the values of sensitive variables with stars\n(<code class=\"docutils literal notranslate\">**********</code>).</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter.hidden_settings\">\n<span class=\"sig-name descname\">hidden_settings</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter.hidden_settings\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>A compiled regular expression object used to match settings and\n<code class=\"docutils literal notranslate\">request.META</code> values considered as sensitive. By default equivalent\nto:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">import</span> <span class=\"nn\">re</span>\n\nre<span class=\"o\">.</span>compile<span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s2\">&quot;API|TOKEN|KEY|SECRET|PASS|SIGNATURE|HTTP_COOKIE&quot;</span><span class=\"p\">,</span> flags<span class=\"o\">=</span>re<span class=\"o\">.</span>IGNORECASE<span class=\"p\">)</span>\n</code></pre></div>\n<aside class=\"version-note version-changed\" data-version=\"4.2\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 4.2</p><p><code class=\"docutils literal notranslate\">HTTP_COOKIE</code> was added.</p>\n</aside>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter.is_active\">\n<span class=\"sig-name descname\">is_active</span><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter.is_active\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns <code class=\"docutils literal notranslate\">True</code> to activate the filtering in\n<a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter.get_post_parameters\" title=\"django.views.debug.SafeExceptionReporterFilter.get_post_parameters\"><code class=\"xref py py-meth docutils literal notranslate\">get_post_parameters()</code></a> and <a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter.get_traceback_frame_variables\" title=\"django.views.debug.SafeExceptionReporterFilter.get_traceback_frame_variables\"><code class=\"xref py py-meth docutils literal notranslate\">get_traceback_frame_variables()</code></a>.\nBy default the filter is active if <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">False</code>. Note\nthat sensitive <code class=\"docutils literal notranslate\">request.META</code> values are always filtered along with\nsensitive setting values, as described in the <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a>\ndocumentation.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter.get_post_parameters\">\n<span class=\"sig-name descname\">get_post_parameters</span><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter.get_post_parameters\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the filtered dictionary of POST parameters. Sensitive values\nare replaced with <a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\" title=\"django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\"><code class=\"xref py py-attr docutils literal notranslate\">cleansed_substitute</code></a>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.SafeExceptionReporterFilter.get_traceback_frame_variables\">\n<span class=\"sig-name descname\">get_traceback_frame_variables</span><span class=\"sig-paren\">(</span><em class=\"sig-param\">request</em>, <em class=\"sig-param\">tb_frame</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.SafeExceptionReporterFilter.get_traceback_frame_variables\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Returns the filtered dictionary of local variables for the given\ntraceback frame. Sensitive values are replaced with\n<a class=\"reference internal\" href=\"#django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\" title=\"django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\"><code class=\"xref py py-attr docutils literal notranslate\">cleansed_substitute</code></a>.</p>\n</dd></dl>\n\n</dd></dl>\n\n<p>If you need to customize error reports beyond filtering you may specify a\ncustom error reporter class by defining the\n<a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER</code></a> setting:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code>DEFAULT_EXCEPTION_REPORTER <span class=\"o\">=</span> <span class=\"s2\">&quot;path.to.your.CustomExceptionReporter&quot;</span>\n</code></pre></div>\n<p>The exception reporter is responsible for compiling the exception report data,\nand formatting it as text or HTML appropriately. (The exception reporter uses\n<a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code></a> when preparing the exception\nreport data.)</p>\n<p>Your custom reporter class needs to inherit from\n<a class=\"reference internal\" href=\"#django.views.debug.ExceptionReporter\" title=\"django.views.debug.ExceptionReporter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.ExceptionReporter</code></a>.</p>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter\">\n<em class=\"property\"><span class=\"k\">class</span> </em><span class=\"sig-name descname\">ExceptionReporter</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter.html_template_path\">\n<span class=\"sig-name descname\">html_template_path</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter.html_template_path\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Property that returns a <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(στη Python έκδοση 3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a> representing the absolute\nfilesystem path to a template for rendering the HTML representation of\nthe exception. Defaults to the Django provided template.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter.text_template_path\">\n<span class=\"sig-name descname\">text_template_path</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter.text_template_path\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Property that returns a <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(στη Python έκδοση 3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a> representing the absolute\nfilesystem path to a template for rendering the plain-text\nrepresentation of the exception. Defaults to the Django provided\ntemplate.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter.get_traceback_data\">\n<span class=\"sig-name descname\">get_traceback_data</span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter.get_traceback_data\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Return a dictionary containing traceback information.</p>\n<p>This is the main extension point for customizing exception reports, for\nexample:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.views.debug</span> <span class=\"kn\">import</span> ExceptionReporter\n\n\n<span class=\"k\">class</span> <span class=\"nc\">CustomExceptionReporter</span><span class=\"p\">(</span>ExceptionReporter<span class=\"p\">):</span>\n    <span class=\"k\">def</span> <span class=\"nf\">get_traceback_data</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        data <span class=\"o\">=</span> <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span>get_traceback_data<span class=\"p\">()</span>\n        <span class=\"c1\"># ... remove/add something here ...</span>\n        <span class=\"k\">return</span> data\n</code></pre></div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter.get_traceback_html\">\n<span class=\"sig-name descname\">get_traceback_html</span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter.get_traceback_html\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Return HTML version of exception report.</p>\n<p>Used for HTML version of debug 500 HTTP error page.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"django.views.debug.ExceptionReporter.get_traceback_text\">\n<span class=\"sig-name descname\">get_traceback_text</span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.views.debug.ExceptionReporter.get_traceback_text\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd><p>Return plain text version of exception report.</p>\n<p>Used for plain text version of debug 500 HTTP error page and email\nreports.</p>\n</dd></dl>\n\n</dd></dl>\n\n<p>As with the filter class, you may control which exception reporter class to use\nwithin any given view by setting the <code class=\"docutils literal notranslate\">HttpRequest</code>’s\n<code class=\"docutils literal notranslate\">exception_reporter_class</code> attribute:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</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=\"Code code\"><code><span class=\"k\">def</span> <span class=\"nf\">my_view</span><span class=\"p\">(</span>request<span class=\"p\">):</span>\n    <span class=\"k\">if</span> request<span class=\"o\">.</span>user<span class=\"o\">.</span>is_authenticated<span class=\"p\">:</span>\n        request<span class=\"o\">.</span>exception_reporter_class <span class=\"o\">=</span> CustomExceptionReporter<span class=\"p\">()</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<aside class=\"admonition admonition-seealso\" role=\"note\">\n<p class=\"admonition-title\">Δείτε επίσης</p>\n<p>Μπορείτε επίσης να ρυθμίσετε τις δικές σας αναφορές σφαλμάτων γράφοντας ένα δικό σας κομμάτι μιας <a class=\"reference internal\" href=\"/el/5.0/topics/http/middleware/#exception-middleware\"><span class=\"std std-ref\">exception middleware</span></a>. Αν όντως γράψετε έναν δικό σας διαχειριστή σφαλμάτων, μια καλή ιδέα είναι να μιμηθείτε τον προεγκατεστημένο διαχειριστή σφαλμάτων του Django και να αναφέρετε ή να κάνετε log τυχόν σφάλματα μόνο αν η ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> είναι <code class=\"docutils literal notranslate\">False</code>.</p>\n</aside>\n</section>\n</section>","rootId":"how-to-manage-error-reporting","toc":[{"title":"Αναφορές email","anchor":"email-reports","children":[{"title":"Σφάλματα server","anchor":"server-errors","children":[]},{"title":"Σφάλματα 404","anchor":"errors","children":[]}]},{"title":"Φιλτράροντας τις αναφορές σφαλμάτων","anchor":"filtering-error-reports","children":[{"title":"Φιλτράροντας ευαίσθητα δεδομένα","anchor":"filtering-sensitive-information","children":[]},{"title":"Παραμετροποιήσιμες αναφορές σφαλμάτων","anchor":"custom-error-reports","children":[]}]}],"breadcrumbs":[{"docname":"howto/index","title":"Οδηγοί «Πως-να»","url":"/el/5.0/howto/"}],"prev":{"docname":"howto/upgrade-version","title":"How to upgrade Django to a newer version","url":"/el/5.0/howto/upgrade-version/"},"next":{"docname":"howto/initial-data","title":"How to provide initial data for models","url":"/el/5.0/howto/initial-data/"},"formats":{"html":"/el/5.0/howto/error-reporting/","markdown":"/el/5.0/howto/error-reporting.md","json":"/el/5.0/howto/error-reporting.json"},"source":"https://github.com/django/django/blob/stable/5.0.x/docs/howto/error-reporting.txt","official":"https://docs.djangoproject.com/el/5.0/howto/error-reporting/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}