{"title":"Writing your first contribution for Django","version":"6.1","locale":"el","docname":"intro/contributing","url":"/el/6.1/intro/contributing/","canonical":"https://djangodocs.dev/el/6.1/intro/contributing/","summary":"Εισαγωγή Link to this heading # Interested in giving back to the community a little? Maybe you’ve found a bug in Django that you’d like to see fixed, or maybe…","html":"<h1>Writing your first contribution for Django<a class=\"heading-anchor\" href=\"#writing-your-first-contribution-for-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<section id=\"introduction\">\n<h2>Εισαγωγή<a class=\"heading-anchor\" href=\"#introduction\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Interested in giving back to the community a little? Maybe you’ve found a bug\nin Django that you’d like to see fixed, or maybe there’s a small feature you\nwant added (but remember that proposals for new features should follow the\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/bugs-and-features/#requesting-features\"><span class=\"std std-ref\">process for suggesting new features</span></a>).</p>\n<p>Contributing back to Django itself is the best way to see your own concerns\naddressed. This may seem daunting at first, but it’s a well-traveled path with\ndocumentation, tooling, and a community to support you. We’ll walk you through\nthe entire process, so you can learn by example.</p>\n<section id=\"who-s-this-tutorial-for\">\n<h3>Σε ποιους απευθύνεται αυτό το tutorial<a class=\"heading-anchor\" href=\"#who-s-this-tutorial-for\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"admonition admonition-seealso\">\n<p class=\"admonition-title\">Δείτε επίσης</p>\n<p>If you are looking for a reference on the details of making code\ncontributions, see the <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/\"><span class=\"doc\">Contributing code</span></a>\ndocumentation.</p>\n</aside>\n<p>For this tutorial, we expect that you have at least a basic understanding of\nhow Django works. This means you should be comfortable going through the\nexisting tutorials on <a class=\"reference internal\" href=\"/el/6.1/intro/tutorial01/\"><span class=\"doc\">writing your first Django app</span></a>.\nIn addition, you should have a good understanding of Python itself. But if you\ndon’t, <a class=\"reference external\" href=\"https://diveintopython3.net/\">Dive Into Python</a> is a fantastic (and free) online book for beginning\nPython programmers.</p>\n<p>Για όσους από εσάς δεν είστε εξοικειωμένοι με τα εργαλεία συστημάτων ελέγχου εκδόσεων (VCS – version control system) και το Trac, δεν υπάρχει λόγος να ανησυχείτε. Αυτός ο οδηγός (και όποιοι σύνδεσμοι-links του) έχει τις απαραίτητες πληροφορίες για να ξεκινήσετε. Ωστόσο, ίσως να θέλετε να μάθετε περισσότερα σχετικά με αυτά τα εργαλεία, αν σκοπεύετε να συνεισφέρετε στο Django τακτικά.</p>\n<p>Εν τούτοις, αυτός ο οδηγός στο μεγαλύτερο του μέρος, προσπαθεί να εξηγήσει όσα περισσότερα μπορεί, ώστε να μπορεί να φανεί χρήσιμος στο μεγαλύτερο δυνατό ευρύ κοινό.</p>\n<aside class=\"admonition-where-to-get-help admonition\">\n<p class=\"admonition-title\">Που να ψάξετε για βοήθεια</p>\n<p>If you’re having trouble going through this tutorial, please post a message\non the <a class=\"reference external\" href=\"https://forum.djangoproject.com/\">Django Forum</a> or drop by the <a class=\"reference external\" href=\"https://chat.djangoproject.com\">Django Discord server</a> to chat with\nother Django users who might be able to help.</p>\n</aside>\n</section>\n<section id=\"what-does-this-tutorial-cover\">\n<h3>Τι καλύπτει αυτός ο οδηγός;<a class=\"heading-anchor\" href=\"#what-does-this-tutorial-cover\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>We’ll be walking you through contributing to Django for the first time. By the\nend of this tutorial, you should have a basic understanding of both the tools\nand the processes involved. Specifically, we’ll be covering the following:</p>\n<ul class=\"simple\">\n<li><p>Εγκατάσταση Git.</p></li>\n<li><p>Downloading a copy of Django’s development version.</p></li>\n<li><p>Εκτέλεση της σουίτας δοκιμών του Django (test suite).</p></li>\n<li><p>Writing a test for your changes.</p></li>\n<li><p>Writing the code for your changes.</p></li>\n<li><p>Testing your changes.</p></li>\n<li><p>Υποβολή αιτήματος έλξης.</p></li>\n<li><p>Που να κοιτάξετε για περισσότερες πληροφορίες.</p></li>\n</ul>\n<p>Once you’re done with the tutorial, you can look through the rest of\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/\"><span class=\"doc\">Django’s documentation on contributing</span></a>.\nIt contains lots of great information and is a must-read for anyone who’d like\nto become a regular contributor to Django. If you’ve got questions, it’s\nprobably got the answers.</p>\n<aside class=\"admonition-for-windows-users admonition\">\n<p class=\"admonition-title\">Για τους χρήστες Windows</p>\n<p>See <a class=\"reference internal\" href=\"/el/6.1/howto/windows/#install-python-windows\"><span class=\"std std-ref\">Εγκατάσταση Python</span></a> on Windows docs for additional guidance.</p>\n</aside>\n</section>\n</section>\n<section id=\"code-of-conduct\">\n<h2>Κώδικας δεοντολογίας<a class=\"heading-anchor\" href=\"#code-of-conduct\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Ως συνεισφέρων, μπορείτε να μας βοηθήσετε να διατηρήσουμε την Django κοινότητα ανοιχτή (open) και περιεκτική (inclusive). Παρακαλούμε διαβάστε και ακολουθήστε το δικό μας <a class=\"reference external\" href=\"https://www.djangoproject.com/conduct/\">Κώδικα Δεοντολογίας</a>.</p>\n</section>\n<section id=\"installing-git\">\n<h2>Εγκατάσταση Git<a class=\"heading-anchor\" href=\"#installing-git\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>For this tutorial, you’ll need Git installed to download the current\ndevelopment version of Django and to generate a branch for the changes you\nmake.</p>\n<p>Για να ελέγξετε αν έχετε εγκατεστημένο το Git, γράψτε στη κονσόλα (ή στη γραμμή εντολών αν έχετε Windows) τη λέξη <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span></code>. Αν βλέπετε μηνύματα που λένε ότι αυτή η εντολή δεν υπάρχει, θα χρειαστεί να κατεβάσετε το Git και να το εγκαταστήσετε. Δείτε πως, στην <a class=\"reference external\" href=\"https://git-scm.com/download\">επίσημη σελίδα του Git</a>.</p>\n<p>Αν δεν είστε εξοικειωμένοι με το Git, μπορείτε να μάθετε περισσότερα σχετικά με τις εντολές του (αφού εγκατασταθεί) πληκτρολογώντας <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">help</span></code> στην κονσόλα (ή στη γραμμή εντολών για χρήστες Windows).</p>\n</section>\n<section id=\"getting-a-copy-of-django-s-development-version\">\n<h2>Δημιουργία αντίγραφου της αναπτυξιακής έκδοσης του Django<a class=\"heading-anchor\" href=\"#getting-a-copy-of-django-s-development-version\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Το πρώτο βήμα για την συνεισφορά στο Django είναι να αποκτήσετε ένα αντίγραφο του πηγαίου κώδικα. Πρώτα, κάντε <a class=\"reference external\" href=\"https://github.com/django/django/fork\">fork το Django από το GitHub</a>. Από την γραμμή εντολών, χρησιμοποιείστε την εντολή <code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span></code> για να μεταβείτε στον φάκελο στον οποίο θέλετε να αποθηκεύσετε τον πηγαίο κώδικα του Django. Αν δεν υπάρχει κάποιος φάκελος της αρεσκείας σας, τότε χρησιμοποιήστε την εντολή <code class=\"docutils literal notranslate\"><span class=\"pre\">mkdir</span></code> για να τον δημιουργήσετε και μετά την εντολή <code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span> <span class=\"pre\">επιθυμητός_φάκελος</span></code> για να αποθηκεύσετε εκεί τον πηγαίο κώδικα.</p>\n<p>Κατεβάστε το αποθετήριο (εφεξής repository ή repo) του πηγαίου κώδικα του Django χρησιμοποιώντας την ακόλουθη εντολή:</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>git<span class=\"w\"> </span>clone<span class=\"w\"> </span>https://github.com/YourGitHubName/django.git\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> git clone https://github.com/YourGitHubName/django.git\n</code></pre></div></div></div>\n<aside class=\"admonition-low-bandwidth-connection admonition\">\n<p class=\"admonition-title\">Low bandwidth connection?</p>\n<p>You can add the <code class=\"docutils literal notranslate\"><span class=\"pre\">--depth</span> <span class=\"pre\">1</span></code> argument to <code class=\"docutils literal notranslate\"><span class=\"pre\">git</span> <span class=\"pre\">clone</span></code> to skip downloading\nall of Django’s commit history, which reduces data transfer from ~250 MB\nto ~70 MB.</p>\n</aside>\n<p>Τώρα που έχετε ένα τοπικό αντίγραφο του Django, μπορείτε να το εγκαταστήσετε με το <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code>, όπως θα εγκαθιστούσατε οποιοδήποτε άλλο πακέτο. ;Ένας καλός τρόπος είναι η δημιουργία <em>virtual environment</em> (απομονωμένο περιβάλλον εργασίας), που θα σας επιτρέψει να έχετε ένα χωριστό φάκελο με τα απαραίτητα πακέτα για κάθε πρότζεκτ σας.</p>\n<p>It’s a good idea to keep all your virtual environments in one place, for\nexample in <code class=\"docutils literal notranslate\"><span class=\"pre\">.virtualenvs/</span></code> in your home directory.</p>\n<p id=\"intro-contributing-install-local-copy\">Create a new virtual environment by running:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-1-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>python3<span class=\"w\"> </span>-m<span class=\"w\"> </span>venv<span class=\"w\"> </span>~/.virtualenvs/djangodev\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-1-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 venv <span class=\"nv\">%HOMEPATH%</span>\\.virtualenvs\\djangodev\n</code></pre></div></div></div>\n<p>Η διαδρομή (path) που εισαγάγατε αποτελεί και το καινούργιο virtualenv το οποίο θα αποθηκευτεί στον υπολογιστή σας.</p>\n<p>The final step in setting up your virtual environment is to activate it:</p>\n<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><span class=\"nb\">source</span><span class=\"w\"> </span>~/.virtualenvs/djangodev/bin/activate\n</code></pre></div>\n<p>Αν η εντολή <code class=\"docutils literal notranslate\"><span class=\"pre\">source</span></code> δεν είναι διαθέσιμη, χρησιμοποιήστε την τελεία, όπως:</p>\n<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>.<span class=\"w\"> </span>~/.virtualenvs/djangodev/bin/activate\n</code></pre></div>\n<p>You have to activate the virtual environment whenever you open a new\nterminal window.</p>\n<aside class=\"admonition-for-windows-users admonition\">\n<p class=\"admonition-title\">Για τους χρήστες Windows</p>\n<p>To activate your virtual environment on Windows, run:</p>\n<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 code\"><code><span class=\"gp\">...\\&gt;</span> <span class=\"nv\">%HOMEPATH%</span>\\.virtualenvs\\djangodev\\Scripts\\activate.bat\n</code></pre></div>\n</aside>\n<p>The name of the currently activated virtual environment is displayed on the\ncommand line to help you keep track of which one you are using. Anything you\ninstall through <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span></code> while this name is displayed will be installed in that\nvirtual environment, isolated from other environments and system-wide packages.</p>\n<p>Go ahead and install the previously cloned copy of Django:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-2-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>-e<span class=\"w\"> </span>/path/to/your/local/clone/django/\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-2-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 -e \\path\\to\\your\\local\\clone\\django\\\n</code></pre></div></div></div>\n<p>The installed version of Django is now pointing at your local copy by\ninstalling in editable mode. You will immediately see any changes you make to\nit, which is of great help when testing your first contribution.</p>\n</section>\n<section id=\"running-django-s-test-suite-for-the-first-time\">\n<h2>Εκτέλεση της σουίτας δοκιμών του Django για πρώτη φορά<a class=\"heading-anchor\" href=\"#running-django-s-test-suite-for-the-first-time\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When contributing to Django it’s very important that your code changes don’t\nintroduce bugs into other areas of Django. One way to check that Django still\nworks after you make your changes is by running Django’s test suite. If all the\ntests still pass, then you can be reasonably sure that your changes work and\nhaven’t broken other parts of Django. If you’ve never run Django’s test suite\nbefore, it’s a good idea to run it once beforehand to get familiar with its\noutput.</p>\n<p>Before running the test suite, enter the Django <code class=\"docutils literal notranslate\"><span class=\"pre\">tests/</span></code> directory using the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span> <span class=\"pre\">tests</span></code> command, and install test dependencies by running:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-3-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>-r<span class=\"w\"> </span>requirements/py3.txt\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-3-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 -r requirements\\py3.txt\n</code></pre></div></div></div>\n<p>If you encounter an error during the installation, your system might be missing\na dependency for one or more of the Python packages. Consult the failing\npackage’s documentation or search the web with the error message that you\nencounter.</p>\n<p>Now we are ready to run the test suite:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-4-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>./runtests.py\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-4-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> runtests.py \n</code></pre></div></div></div>\n<p>Now sit back and relax. Django’s entire test suite has thousands of tests, and\nit takes at least a few minutes to run, depending on the speed of your\ncomputer.</p>\n<p>While Django’s test suite is running, you’ll see a stream of characters\nrepresenting the status of each test as it completes. <code class=\"docutils literal notranslate\"><span class=\"pre\">E</span></code> indicates that an\nerror was raised during a test, and <code class=\"docutils literal notranslate\"><span class=\"pre\">F</span></code> indicates that a test’s assertions\nfailed. Both of these are considered to be test failures. Meanwhile, <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">s</span></code> indicate expected failures and skipped tests, respectively. Dots indicate\npassing tests.</p>\n<p>Τα παραλειπόμενα τεστ (τεστ που δεν έγιναν) προκύπτουν συνήθως λόγω έλλειψης κάποιων εξωτερικών βιβλιοθηκών (external libraries) οι οποίες χρειάζονται για να τρέξει το τεστ. Δείτε στο <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/unit-tests/#running-unit-tests-dependencies\"><span class=\"std std-ref\">Τρέχοντας όλα τα τεστ</span></a> για μια λίστα με όλα τα dependencies (εξαρτώμενα πακέτα – εξωτερικές βιβλιοθήκες). Επίσης σιγουρευτείτε ότι έχετε εγκαταστήσει τα απαραίτητα πακέτα (στα οποία εξαρτώνται τα τεστ) προτού τρέξετε κάποιο τεστ (δεν θα χρειαστούμε κάποιο από αυτά σε αυτόν τον οδηγό). Μερικά τεστ είναι γραμμένα και συνδέονται με μια συγκεκριμένη βάση δεδομένων και δεν θα τρέξουν αν δεν υπάρχει εγκατεστημένη η αντίστοιχη βάση δεδομένων καθώς και το πακέτο (βιβλιοθήκη) που συνδέει την database με το Django (π.χ για την PostgreSQL το πακέτο είναι το <code class=\"docutils literal notranslate\"><span class=\"pre\">psycopg2</span></code>). Η SQLite είναι η βάση δεδομένων που χρησιμοποιεί το Django ως προεπιλογή. Μπορείτε επίσης να <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/unit-tests/#running-unit-tests-settings\"><span class=\"std std-ref\">τρέξετε τα τεστ χρησιμοποιώντας μια διαφορετική βάση δεδομένων</span></a>.</p>\n<p>Όταν ολοκληρωθούν τα τεστ, θα σας εμφανιστεί κάποιο μήνυμα που θα σας ενημερώνει για την επιτυχή ή όχι εκτέλεση τους. Εφόσον δεν έχετε κάνει κάποια αλλαγή μέχρι τώρα στον πηγαίο κώδικα του Django, όλα τα τεστ θα <strong>πρέπει</strong> να έχουν επιτυχή έκβαση. Αν δείτε τυχόν σφάλματα ή αποτυχίες κάποιων τεστ, σιγουρευτείτε ότι έχετε ακολουθήσει κατάλληλα τα ανωτέρω βήματα. Δείτε στο <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/unit-tests/#running-unit-tests\"><span class=\"std std-ref\">τρέχοντας τα unit τεστ</span></a> για περισσότερες πληροφορίες. Αν χρησιμοποιείτε την Python 3.5+, θα υπάρξουν κάποιες αποτυχίες μερικών τεστ οι οποίες οφείλονται σε προειδοποιήσεις υποβάθμισης (deprecation warnings) στις οποίες μπορείτε να μην δώσετε σημασία. Αυτές οι αποτυχίες έχουν αποκατασταθεί στην τρέχουσα έκδοση του Django. Σας υπενθυμίζουμε ότι σε αυτόν τον οδηγό χρησιμοποιούμε μια παλιά έκδοση του Django.</p>\n<p>Note that the latest Django «main» branch may not always be stable. When\ndeveloping against «main», you can check <a class=\"reference external\" href=\"https://djangoci.com\">Django’s continuous integration\nbuilds</a> to determine if the failures are specific to your machine or if they\nare also present in Django’s official builds. If you click to view a particular\nbuild, you can view the «Configuration Matrix» which shows failures broken down\nby Python version and database backend.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Σημείωση</p>\n<p>For this tutorial and the ticket we’re working on, testing against SQLite\nis sufficient, however, it’s possible (and sometimes necessary) to\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/unit-tests/#running-unit-tests-settings\"><span class=\"std std-ref\">run the tests using a different database</span></a>. When making UI changes, you will need to\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/unit-tests/#running-selenium-tests\"><span class=\"std std-ref\">run the Selenium tests</span></a>.</p>\n</aside>\n</section>\n<section id=\"working-on-an-approved-new-feature\">\n<h2>Working on an approved new feature<a class=\"heading-anchor\" href=\"#working-on-an-approved-new-feature\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>For this tutorial, we’ll work on a «fake accepted ticket» as a case study. Here\nare the imaginary details:</p>\n<aside class=\"admonition-ticket-99999-allow-making-toast admonition\">\n<p class=\"admonition-title\">Ticket #99999 – Allow making toast</p>\n<p>Django should provide a function <code class=\"docutils literal notranslate\"><span class=\"pre\">django.shortcuts.make_toast()</span></code> that\nreturns <code class=\"docutils literal notranslate\"><span class=\"pre\">'toast'</span></code>.</p>\n</aside>\n<p>We’ll now implement this feature and associated tests.</p>\n</section>\n<section id=\"creating-a-branch\">\n<h2>Creating a branch<a class=\"heading-anchor\" href=\"#creating-a-branch\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Πριν κάνετε αλλαγές, δημιουργήστε ένα νέο τμήμα για το εισητήριο</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-5-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>git<span class=\"w\"> </span>checkout<span class=\"w\"> </span>-b<span class=\"w\"> </span>ticket_99999\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-5-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> git checkout -b ticket_99999\n</code></pre></div></div></div>\n<p>You can choose any name that you want for the branch, «ticket_99999» is an\nexample. All changes made in this branch will be specific to the ticket and\nwon’t affect the main copy of the code that we cloned earlier.</p>\n</section>\n<section id=\"writing-some-tests-for-your-ticket\">\n<h2>Γράφοντας μερικά τεστ για το ticket<a class=\"heading-anchor\" href=\"#writing-some-tests-for-your-ticket\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>In most cases, for a contribution to be accepted into Django it has to include\ntests. For bug fix contributions, this means writing a regression test to\nensure that the bug is never reintroduced into Django later on. A regression\ntest should be written in such a way that it will fail while the bug still\nexists and pass once the bug has been fixed. For contributions containing new\nfeatures, you’ll need to include tests which ensure that the new features are\nworking correctly. They too should fail when the new feature is not present,\nand then pass once it has been implemented.</p>\n<p>A good way to do this is to write your new tests first, before making any\nchanges to the code. This style of development is called\n<a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Test-driven_development\">test-driven development</a> and can be applied to both entire projects and\nsingle changes. After writing your tests, you then run them to make sure that\nthey do indeed fail (since you haven’t fixed that bug or added that feature\nyet). If your new tests don’t fail, you’ll need to fix them so that they do.\nAfter all, a regression test that passes regardless of whether a bug is present\nis not very helpful at preventing that bug from reoccurring down the road.</p>\n<p>Ας εργαστούμε λοιπόν στο παράδειγμα μας.</p>\n<section id=\"writing-a-test-for-ticket-99999\">\n<h3>Writing a test for ticket #99999<a class=\"heading-anchor\" href=\"#writing-a-test-for-ticket-99999\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>In order to resolve this ticket, we’ll add a <code class=\"docutils literal notranslate\"><span class=\"pre\">make_toast()</span></code> function to the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django.shortcuts</span></code> module. First we are going to write a test that tries to\nuse the function and check that its output looks correct.</p>\n<p>Navigate to Django’s <code class=\"docutils literal notranslate\"><span class=\"pre\">tests/shortcuts/</span></code> folder and create a new file\n<code class=\"docutils literal notranslate\"><span class=\"pre\">test_make_toast.py</span></code>. Add the following 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=\"w\"> </span><span class=\"nn\">django.shortcuts</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">make_toast</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.test</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">SimpleTestCase</span>\n\n\n<span class=\"k\">class</span><span class=\"w\"> </span><span class=\"nc\">MakeToastTests</span><span class=\"p\">(</span><span class=\"n\">SimpleTestCase</span><span class=\"p\">):</span>\n    <span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">test_make_toast</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">assertEqual</span><span class=\"p\">(</span><span class=\"n\">make_toast</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;toast&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>This test checks that the <code class=\"docutils literal notranslate\"><span class=\"pre\">make_toast()</span></code> returns <code class=\"docutils literal notranslate\"><span class=\"pre\">'toast'</span></code>.</p>\n<aside class=\"admonition-but-this-testing-thing-looks-kinda-hard admonition\">\n<p class=\"admonition-title\">Μήπως σας φάνηκε δύσκολο αυτό το τεστ;</p>\n<p>Αν δεν έχετε γράψει ποτέ στο παρελθόν κάποιο τεστ και πρώτη φορά συναναστρέφεστε με αυτό, στην αρχή ίσως σας φανεί κάπως δύσκολο. Δεν υπάρχει όμως λόγος να ανησυχείτε καθώς η ενότητα testing είναι ένα <em>τεράστιο</em> κεφάλαιο στον προγραμματισμό, που σημαίνει ότι υπάρχει εκτενής και πολλή πληροφορία πάνω σε αυτό το θέμα:</p>\n<ul class=\"simple\">\n<li><p>Μια πρώτη ματιά για τη σύνταξη των τεστ για το Django μπορείτε να βρείτε στην ενότητα του εγχειριδίου (documentation) <a class=\"reference internal\" href=\"/el/6.1/topics/testing/overview/\"><span class=\"doc\">σύνταξη και εκτέλεση των τεστ</span></a>.</p></li>\n<li><p>Το βιβλίο Dive Into Python (δωρεάν για αρχάριους developers στην γλώσσα προγραμματισμού Python) περιέχει μια πολύ καλή <a class=\"reference external\" href=\"https://diveintopython3.net/unit-testing.html\">εισαγωγή στο Unit Testing</a>.</p></li>\n<li><p>Αφού διαβάσετε τα ανωτέρω και επιθυμείτε να εμβαθύνετε τις γνώσεις σας περί του θέματος, υπάρχει πάντα το εγχειρίδιο <a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#module-unittest\" title=\"(στη Python έκδοση 3.14)\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">unittest</span></code></a> της Python.</p></li>\n</ul>\n</aside>\n</section>\n<section id=\"running-your-new-test\">\n<h3>Τρέχοντας το τεστ<a class=\"heading-anchor\" href=\"#running-your-new-test\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Since we haven’t made any modifications to <code class=\"docutils literal notranslate\"><span class=\"pre\">django.shortcuts</span></code> yet, our test\nshould fail. Let’s run all the tests in the <code class=\"docutils literal notranslate\"><span class=\"pre\">shortcuts</span></code> folder to make sure\nthat’s really what happens. <code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span></code> to the Django <code class=\"docutils literal notranslate\"><span class=\"pre\">tests/</span></code> directory and run:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-6-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>./runtests.py<span class=\"w\"> </span>shortcuts\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-6-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> runtests.py shortcuts\n</code></pre></div></div></div>\n<p>If the tests ran correctly, you should see one failure corresponding to the\ntest method we added, with this error:</p>\n<div class=\"code-block\" data-language=\"pytb\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Pytb</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=\"Pytb code\"><code><span class=\"x\">ImportError: cannot import name &#39;make_toast&#39; from &#39;django.shortcuts&#39;</span>\n</code></pre></div>\n<p>If all of the tests passed, then you’ll want to make sure that you added the\nnew test shown above to the appropriate folder and file name.</p>\n</section>\n</section>\n<section id=\"writing-the-code-for-your-ticket\">\n<h2>Γράφοντας κώδικα για το ticket<a class=\"heading-anchor\" href=\"#writing-the-code-for-your-ticket\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Next we’ll be adding the <code class=\"docutils literal notranslate\"><span class=\"pre\">make_toast()</span></code> function.</p>\n<p>Navigate to the <code class=\"docutils literal notranslate\"><span class=\"pre\">django/</span></code> folder and open the <code class=\"docutils literal notranslate\"><span class=\"pre\">shortcuts.py</span></code> file. At the\nbottom, add:</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=\"w\"> </span><span class=\"nf\">make_toast</span><span class=\"p\">():</span>\n    <span class=\"k\">return</span> <span class=\"s2\">&quot;toast&quot;</span>\n</code></pre></div>\n<p>Now we need to make sure that the test we wrote earlier passes, so we can see\nwhether the code we added is working correctly. Again, navigate to the Django\n<code class=\"docutils literal notranslate\"><span class=\"pre\">tests/</span></code> directory and run:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-7-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>./runtests.py<span class=\"w\"> </span>shortcuts\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-7-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> runtests.py shortcuts\n</code></pre></div></div></div>\n<p>Everything should pass. If it doesn’t, make sure you correctly added the\nfunction to the correct file.</p>\n</section>\n<section id=\"running-django-s-test-suite-for-the-second-time\">\n<h2>Εκτέλεση της σουίτας δοκιμών του Django για δεύτερη φορά<a class=\"heading-anchor\" href=\"#running-django-s-test-suite-for-the-second-time\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Once you’ve verified that your changes and test are working correctly, it’s\na good idea to run the entire Django test suite to verify that your change\nhasn’t introduced any bugs into other areas of Django. While successfully\npassing the entire test suite doesn’t guarantee your code is bug free, it does\nhelp identify many bugs and regressions that might otherwise go unnoticed.</p>\n<p>Για να τρέξετε ολόκληρη τη σουίτα δοκιμών του Django, πληκτρολογήστε <code class=\"docutils literal notranslate\"><span class=\"pre\">cd</span> <span class=\"pre\">tests/</span></code> και τρέξτε:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-8-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>./runtests.py\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-8-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> runtests.py \n</code></pre></div></div></div>\n</section>\n<section id=\"writing-documentation\">\n<h2>Γράφοντας το εγχειρίδιο (documentation)<a class=\"heading-anchor\" href=\"#writing-documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>This is a new feature, so it should be documented. Open the file\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/topics/http/shortcuts.txt</span></code> and add the following at the end of the\nfile:</p>\n<div class=\"code-block\" data-language=\"rst\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Rst</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=\"Rst code\"><code><span class=\"gh\">``make_toast()``</span>\n<span class=\"gh\">================</span>\n\n<span class=\"p\">..</span> <span class=\"ow\">function</span><span class=\"p\">::</span> make_toast()\n\n<span class=\"p\">..</span> <span class=\"ow\">versionadded</span><span class=\"p\">::</span> 6.2\n\nReturns <span class=\"s\">``&#39;toast&#39;``</span>.\n</code></pre></div>\n<p>Since this new feature will be in an upcoming release it is also added to the\nrelease notes for the next version of Django. Open the release notes for the\nlatest version in <code class=\"docutils literal notranslate\"><span class=\"pre\">docs/releases/</span></code>, which at time of writing is <code class=\"docutils literal notranslate\"><span class=\"pre\">6.2.txt</span></code>.\nAdd a note under the «Minor Features» header:</p>\n<div class=\"code-block\" data-language=\"rst\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Rst</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=\"Rst code\"><code><span class=\"gh\">:mod:`django.shortcuts`</span>\n<span class=\"gh\">~~~~~~~~~~~~~~~~~~~~~~~</span>\n\n<span class=\"m\">*</span> The new <span class=\"na\">:func:</span><span class=\"nv\">`django.shortcuts.make_toast`</span> function returns <span class=\"s\">``&#39;toast&#39;``</span>.\n</code></pre></div>\n<p>Για περισσότερες πληροφορίες σχετικά με οδηγίες σύνταξης του εγχειριδίου (περιέχει και την εξήγηση του <code class=\"docutils literal notranslate\"><span class=\"pre\">versionadded</span></code>), δείτε στο <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-documentation/\"><span class=\"doc\">γράφοντας το εγχειρίδιο</span></a>. Αυτή η σελίδα εξηγεί και το πως να δημιουργήσετε ένα αντίγραφο του εγχειριδίου σας τοπικά (στον υπολογιστή σας), ούτως ώστε να δείτε πως θα φαίνεται online στο επίσημο site του Django.</p>\n</section>\n<section id=\"previewing-your-changes\">\n<h2>Προβολή των αλλαγών σας<a class=\"heading-anchor\" href=\"#previewing-your-changes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Now it’s time to review the changes made in the branch. To stage all the\nchanges ready for commit, run:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-9-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>git<span class=\"w\"> </span>add<span class=\"w\"> </span>--all\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-9-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> git add --all\n</code></pre></div></div></div>\n<p>Then display the differences between your current copy of Django (with your\nchanges) and the revision that you initially checked out earlier in the\ntutorial with:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-10-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>git<span class=\"w\"> </span>diff<span class=\"w\"> </span>--cached\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-10-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> git diff --cached\n</code></pre></div></div></div>\n<p>Χρησιμοποιήστε τα βέλη για να κινηθείτε προς τα επάνω και προς τα κάτω.</p>\n<div class=\"code-block\" data-language=\"diff\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Diff</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=\"Diff code\"><code><span class=\"gh\">diff --git a/django/shortcuts.py b/django/shortcuts.py</span>\n<span class=\"gh\">index 7ab1df0e9d..8dde9e28d9 100644</span>\n<span class=\"gd\">--- a/django/shortcuts.py</span>\n<span class=\"gi\">+++ b/django/shortcuts.py</span>\n<span class=\"gu\">@@ -156,3 +156,7 @@ def resolve_url(to, *args, **kwargs):</span>\n\n<span class=\"w\"> </span>    # Finally, fall back and assume it&#39;s a URL\n<span class=\"w\"> </span>    return to\n<span class=\"gi\">+</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+def make_toast():</span>\n<span class=\"gi\">+    return &#39;toast&#39;</span>\n<span class=\"gh\">diff --git a/docs/releases/6.2.txt b/docs/releases/6.2.txt</span>\n<span class=\"gh\">index 7d85d30c4a..81518187b3 100644</span>\n<span class=\"gd\">--- a/docs/releases/6.2.txt</span>\n<span class=\"gi\">+++ b/docs/releases/6.2.txt</span>\n<span class=\"gu\">@@ -34,6 +34,11 @@</span>\n<span class=\"w\"> </span>Minor features\n<span class=\"w\"> </span>--------------\n\n<span class=\"gi\">+:mod:`django.shortcuts`</span>\n<span class=\"gi\">+~~~~~~~~~~~~~~~~~~~~~~~</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+* The new :func:`django.shortcuts.make_toast` function returns ``&#39;toast&#39;``.</span>\n<span class=\"gi\">+</span>\n<span class=\"w\"> </span>:mod:`django.contrib.admin`\n<span class=\"w\"> </span>~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n<span class=\"gh\">diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt</span>\n<span class=\"gh\">index 7b3a3a2c00..711bf6bb6d 100644</span>\n<span class=\"gd\">--- a/docs/topics/http/shortcuts.txt</span>\n<span class=\"gi\">+++ b/docs/topics/http/shortcuts.txt</span>\n<span class=\"gu\">@@ -271,3 +271,12 @@ This example is equivalent to::</span>\n<span class=\"w\"> </span>        my_objects = list(MyModel.objects.filter(published=True))\n<span class=\"w\"> </span>        if not my_objects:\n<span class=\"w\"> </span>            raise Http404(&quot;No MyModel matches the given query.&quot;)\n<span class=\"gi\">+</span>\n<span class=\"gi\">+``make_toast()``</span>\n<span class=\"gi\">+================</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+.. function:: make_toast()</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+.. versionadded:: 6.2</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+Returns ``&#39;toast&#39;``.</span>\n<span class=\"gh\">diff --git a/tests/shortcuts/test_make_toast.py b/tests/shortcuts/test_make_toast.py</span>\nnew file mode 100644\n<span class=\"gh\">index 0000000000..6f4c627b6e</span>\n<span class=\"gd\">--- /dev/null</span>\n<span class=\"gi\">+++ b/tests/shortcuts/test_make_toast.py</span>\n<span class=\"gu\">@@ -0,0 +1,7 @@</span>\n<span class=\"gi\">+from django.shortcuts import make_toast</span>\n<span class=\"gi\">+from django.test import SimpleTestCase</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+</span>\n<span class=\"gi\">+class MakeToastTests(SimpleTestCase):</span>\n<span class=\"gi\">+    def test_make_toast(self):</span>\n<span class=\"gi\">+        self.assertEqual(make_toast(), &#39;toast&#39;)</span>\n</code></pre></div>\n<p>When you’re done previewing the changes, hit the <code class=\"docutils literal notranslate\"><span class=\"pre\">q</span></code> key to return to the\ncommand line. If the diff looked okay, it’s time to commit the changes.</p>\n</section>\n<section id=\"committing-the-changes\">\n<h2>Committing the changes<a class=\"heading-anchor\" href=\"#committing-the-changes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Για να κάνετε commit τις αλλαγές γράψτε:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-11-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>git<span class=\"w\"> </span>commit\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-11-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> git commit\n</code></pre></div></div></div>\n<p>Η παραπάνω εντολή ανοίγει έναν επεξεργαστή κειμένου για να γράψετε το μήνυμα του commit. Ακολουθήστε τις <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/committing-code/#committing-guidelines\"><span class=\"std std-ref\">οδηγίες για ένα σωστό μήνυμα commit</span></a> και γράψτε ένα μήνυμα όπως:</p>\n<div class=\"code-block\" data-language=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</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=\"Text code\"><code>Fixed #99999 -- Added a shortcut function to make toast.\n</code></pre></div>\n</section>\n<section id=\"pushing-the-commit-and-making-a-pull-request\">\n<h2>Κάνοντας push το commit καθώς και ένα pull request<a class=\"heading-anchor\" href=\"#pushing-the-commit-and-making-a-pull-request\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>After committing the changes, send it to your fork on GitHub (substitute\n«ticket_99999» with the name of your branch if it’s different):</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-12-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>git<span class=\"w\"> </span>push<span class=\"w\"> </span>origin<span class=\"w\"> </span>ticket_99999\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-12-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> git push origin ticket_99999\n</code></pre></div></div></div>\n<p>Μπορείτε να δημιουργήσετε ένα pull request πηγαίνοντας στην <a class=\"reference external\" href=\"https://github.com/django/django/\">επίσημη σελίδα του Django στο GitHub</a>. Εκεί θα δείτε το δικό σας branch κάτω από την ετικέτα «Your recently pushed branches». Κάντε κλικ στο «Compare &amp; pull request».</p>\n<p>Please don’t do it for this tutorial, but on the next page that displays a\npreview of the changes, you would click «Create pull request».</p>\n</section>\n<section id=\"next-steps\">\n<h2>Επόμενα βήματα<a class=\"heading-anchor\" href=\"#next-steps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Συγχαρητήρια! Μόλις μάθατε πως να κάνετε pull requests στο Django! Λεπτομέρειες για περισσότερο ανεπτυγμένες τεχνικές, που ίσως χρειαστείτε, θα βρείτε στο <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/working-with-git/\"><span class=\"doc\">Working with Git and GitHub</span></a>.</p>\n<p>Τώρα μπορείτε να χρησιμοποιήσετε αυτές τις τεχνικές για καλό σκοπό βελτιώνοντας τον πηγαίο κώδικα του Django.</p>\n<section id=\"more-information-for-new-contributors\">\n<h3>Περισσότερες πληροφορίες για του νέους στην συνεισφορά<a class=\"heading-anchor\" href=\"#more-information-for-new-contributors\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Before you get too into contributing to Django, there’s a little more\ninformation on contributing that you should probably take a look at:</p>\n<ul class=\"simple\">\n<li><p>You should make sure to read Django’s documentation on\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/submitting-patches/\"><span class=\"doc\">claiming tickets and submitting pull requests</span></a>.\nIt covers Trac etiquette, how to claim tickets for yourself, expected\ncoding style (both for code and docs), and many other important details.</p></li>\n<li><p>Όσοι από εσάς συνεισφέρουν για πρώτη φορά στο Django θα πρέπει να διαβάσουν <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/new-contributors/\"><span class=\"doc\">το εγχειρίδιο του Django για τους νέους συνεισφέροντες</span></a>. Περιέχει πολλές και χρήσιμες συμβουλές για εκείνους που θέλουν να βοηθήσουν-υποστηρίξουν την Django κοινότητα.</p></li>\n<li><p>Κατόπιν των ανωτέρω, αν θέλετε να μάθετε ακόμη περισσότερα σχετικά με την συνεισφορά, μπορείτε πάντα να ανατρέχετε στην ενότητα του εγχειρίδίου <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/\"><span class=\"doc\">του Django σχετικά με την συνεισφορά</span></a>. Περιέχει τόνους πληροφορίας και θα πρέπει να είναι η πρώτη πηγή που θα κοιτάξετε για τυχόν ερωτήσεις ή απορίες που μπορεί να προκύψουν.</p></li>\n</ul>\n</section>\n<section id=\"finding-your-first-real-ticket\">\n<h3>Εύρεση του πρώτου αληθινού ticket<a class=\"heading-anchor\" href=\"#finding-your-first-real-ticket\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Once you’ve looked through some of that information, you’ll be ready to go out\nand find a ticket of your own to contribute to. Pay special attention to\ntickets with the «easy pickings» criterion. These tickets are often much\nsimpler in nature and are great for first time contributors. Once you’re\nfamiliar with contributing to Django, you can start working on more difficult\nand complicated tickets.</p>\n<p>If you just want to get started already (and nobody would blame you!), try\ntaking a look at the list of <a class=\"reference external\" href=\"https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;has_patch=0&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority\">easy tickets without a branch</a> and the\n<a class=\"reference external\" href=\"https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_better_patch=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority\">easy tickets that have branches which need improvement</a>. If you’re familiar\nwith writing tests, you can also look at the list of\n<a class=\"reference external\" href=\"https://code.djangoproject.com/query?status=new&amp;status=reopened&amp;needs_tests=1&amp;easy=1&amp;col=id&amp;col=summary&amp;col=status&amp;col=owner&amp;col=type&amp;col=milestone&amp;order=priority\">easy tickets that need tests</a>. Remember to follow the guidelines about\nclaiming tickets that were mentioned in the link to Django’s documentation on\n<a class=\"reference internal\" href=\"/el/6.1/internals/contributing/writing-code/submitting-patches/\"><span class=\"doc\">claiming tickets and submitting branches</span></a>.</p>\n</section>\n<section id=\"what-s-next-after-creating-a-pull-request\">\n<h3>Τι γίνετε μετά, αφότου δημιουργήσω ένα pull request;<a class=\"heading-anchor\" href=\"#what-s-next-after-creating-a-pull-request\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>After a ticket has a branch, it needs to be reviewed by a second set of eyes.\nAfter submitting a pull request, update the ticket metadata by setting the\nflags on the ticket to say «has patch», «doesn’t need tests», etc, so others\ncan find it for review. Contributing doesn’t necessarily always mean writing\ncode from scratch. Reviewing open pull requests is also a very helpful\ncontribution. See <a class=\"reference internal\" href=\"/el/6.1/internals/contributing/triaging-tickets/\"><span class=\"doc\">Triaging tickets</span></a> for details.</p>\n</section>\n</section>","rootId":"writing-your-first-contribution-for-django","toc":[{"title":"Εισαγωγή","anchor":"introduction","children":[{"title":"Σε ποιους απευθύνεται αυτό το tutorial","anchor":"who-s-this-tutorial-for","children":[]},{"title":"Τι καλύπτει αυτός ο οδηγός;","anchor":"what-does-this-tutorial-cover","children":[]}]},{"title":"Κώδικας δεοντολογίας","anchor":"code-of-conduct","children":[]},{"title":"Εγκατάσταση Git","anchor":"installing-git","children":[]},{"title":"Δημιουργία αντίγραφου της αναπτυξιακής έκδοσης του Django","anchor":"getting-a-copy-of-django-s-development-version","children":[]},{"title":"Εκτέλεση της σουίτας δοκιμών του Django για πρώτη φορά","anchor":"running-django-s-test-suite-for-the-first-time","children":[]},{"title":"Working on an approved new feature","anchor":"working-on-an-approved-new-feature","children":[]},{"title":"Creating a branch","anchor":"creating-a-branch","children":[]},{"title":"Γράφοντας μερικά τεστ για το ticket","anchor":"writing-some-tests-for-your-ticket","children":[{"title":"Writing a test for ticket #99999","anchor":"writing-a-test-for-ticket-99999","children":[]},{"title":"Τρέχοντας το τεστ","anchor":"running-your-new-test","children":[]}]},{"title":"Γράφοντας κώδικα για το ticket","anchor":"writing-the-code-for-your-ticket","children":[]},{"title":"Εκτέλεση της σουίτας δοκιμών του Django για δεύτερη φορά","anchor":"running-django-s-test-suite-for-the-second-time","children":[]},{"title":"Γράφοντας το εγχειρίδιο (documentation)","anchor":"writing-documentation","children":[]},{"title":"Προβολή των αλλαγών σας","anchor":"previewing-your-changes","children":[]},{"title":"Committing the changes","anchor":"committing-the-changes","children":[]},{"title":"Κάνοντας push το commit καθώς και ένα pull request","anchor":"pushing-the-commit-and-making-a-pull-request","children":[]},{"title":"Επόμενα βήματα","anchor":"next-steps","children":[{"title":"Περισσότερες πληροφορίες για του νέους στην συνεισφορά","anchor":"more-information-for-new-contributors","children":[]},{"title":"Εύρεση του πρώτου αληθινού ticket","anchor":"finding-your-first-real-ticket","children":[]},{"title":"Τι γίνετε μετά, αφότου δημιουργήσω ένα pull request;","anchor":"what-s-next-after-creating-a-pull-request","children":[]}]}],"breadcrumbs":[{"docname":"intro/index","title":"Ξεκινώντας","url":"/el/6.1/intro/"}],"prev":{"docname":"intro/whatsnext","title":"Τι να διαβάσετε μετά","url":"/el/6.1/intro/whatsnext/"},"next":{"docname":"topics/index","title":"Using Django","url":"/el/6.1/topics/"},"formats":{"html":"/el/6.1/intro/contributing/","markdown":"/el/6.1/intro/contributing.md","json":"/el/6.1/intro/contributing.json"},"source":"https://github.com/django/django/blob/stable/6.1.x/docs/intro/contributing.txt","official":"https://docs.djangoproject.com/el/6.1/intro/contributing/","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","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}