{"title":"Συχνές Ερωτήσεις: Το admin site","version":"5.0","locale":"el","docname":"faq/admin","url":"/el/5.0/faq/admin/","canonical":"https://djangodocs.dev/el/5.0/faq/admin/","summary":"Δε μπορώ να συνδεθώ. Όταν εισάγω τα σωστά username και password, επαναφορτώνεται η ίδια login σελίδα, χωρίς μηνύματα σφάλματος. Link to this heading # Το cookie που…","html":"<h1>Συχνές Ερωτήσεις: Το admin site<a class=\"heading-anchor\" href=\"#faq-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<section id=\"i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-just-brings-up-the-login-page-again-with-no-error-messages\">\n<h2>Δε μπορώ να συνδεθώ. Όταν εισάγω τα σωστά username και password, επαναφορτώνεται η ίδια login σελίδα, χωρίς μηνύματα σφάλματος.<a class=\"heading-anchor\" href=\"#i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-just-brings-up-the-login-page-again-with-no-error-messages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Το cookie που αφορά το login δεν έχει σεταριστεί σωστά, επειδή το domain του cookie που έστειλε το Django δεν ταιριάζει με το domain στον browser σας. Δοκιμάστε να θέσετε τη ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-SESSION_COOKIE_DOMAIN\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">SESSION_COOKIE_DOMAIN</span></code></a> μέσα στο γενικό αρχείο ρυθμίσεων ούτως ώστε να ταιριάζει με το domain σας. Για παράδειγμα, αν επισκέπτεστε τη σελίδα «<a class=\"reference external\" href=\"https://www.example.com/admin/\">https://www.example.com/admin/</a>» με τον browser, τότε στο γενικό αρχείο ρυθμίσεων του project σας, «myproject.settings», θα θέσετε τη ρύθμιση <a class=\"reference internal\" href=\"/el/5.0/ref/settings/#std-setting-SESSION_COOKIE_DOMAIN\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">SESSION_COOKIE_DOMAIN</span></code></a> = “www.example.com”.</p>\n</section>\n<section id=\"i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-brings-up-the-login-page-again-with-a-please-enter-a-correct-username-and-password-error\">\n<h2>Δε μπορώ να συνδεθώ. Όταν εισάγω τα σωστά username και password, επαναφορτώνεται η ίδια login σελίδα, με ένα σφάλμα που λέει «Παρακαλώ εισάγετε το σωστό username και κωδικό».<a class=\"heading-anchor\" href=\"#i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-brings-up-the-login-page-again-with-a-please-enter-a-correct-username-and-password-error\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Εάν είστε σίγουροι ότι το όνομα χρήστη και ο κωδικός σας είναι σωστά, σιγουρευτείτε ότι η τιμή της ρύθμισης <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/auth/#django.contrib.auth.models.User.is_active\" title=\"django.contrib.auth.models.User.is_active\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">is_active</span></code></a> και <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/auth/#django.contrib.auth.models.User.is_staff\" title=\"django.contrib.auth.models.User.is_staff\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">is_staff</span></code></a>, του λογαριασμού σας, είναι True. Το admin site επιτρέπει την είσοδο μόνο σε άτομα που η τιμή και των δύο αυτών πεδίων είναι True.</p>\n</section>\n<section id=\"how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin\">\n<h2>Πως μπορώ να σετάρω μια τιμή ενός πεδίου πάνω στον χρήστη που αλληλεπίδρασε τελευταίος με κάποιο object μέσω του admin;<a class=\"heading-anchor\" href=\"#how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Η κλάση <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin\" title=\"django.contrib.admin.ModelAdmin\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">ModelAdmin</span></code></a> παρέχει παραμετροποιήσιμα  hooks τα οποία σας επιτρέπουν να επιδράσετε με ένα object πριν και μετά την αποθήκευση του, χρησιμοποιώντας πληροφορίες από το request. Αντλώντας τον τρέχον χρήστη από το request και κάνοντας override τη μέθοδο (ή hook, αν θέλετε) <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model\" title=\"django.contrib.admin.ModelAdmin.save_model\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">save_model()</span></code></a>, μπορείτε να αλλάξετε το object προκειμένου να δείχνει στον user που το άλλαξε. Δείτε στο <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#model-admin-methods\"><span class=\"std std-ref\">εγχειρίδιο σχετικά με τις μεθόδους του ModelAdmin</span></a> για παραδείγματα.</p>\n</section>\n<section id=\"how-do-i-limit-admin-access-so-that-objects-can-only-be-edited-by-the-users-who-created-them\">\n<h2>Πως μπορώ να περιορίσω την πρόσβαση στο admin site ούτως ώστε τα objects να τα επεξεργάζονται μόνο οι χρήστες που τα δημιούργησαν;<a class=\"heading-anchor\" href=\"#how-do-i-limit-admin-access-so-that-objects-can-only-be-edited-by-the-users-who-created-them\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Η κλάση <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin\" title=\"django.contrib.admin.ModelAdmin\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">ModelAdmin</span></code></a> παρέχει, επίσης, επιπλέον hooks (μεθόδους, αν θέλετε) τα οποία σας επιτρέπουν να ελέγχετε την προβολή ή όχι καθώς και την δυνατότητα επεξεργασίας των objects στο admin. Χρησιμοποιώντας την ίδια μέθοδο άντλησης του user από το request, οι μέθοδοι <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_queryset\" title=\"django.contrib.admin.ModelAdmin.get_queryset\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">get_queryset()</span></code></a> και <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.has_change_permission\" title=\"django.contrib.admin.ModelAdmin.has_change_permission\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">has_change_permission()</span></code></a> μπορούν να χρησιμοποιηθούν προκειμένου να ελέγξετε την προβολή ή όχι καθώς και την δυνατότητα επεξεργασίας των objects στο admin.</p>\n</section>\n<section id=\"my-admin-site-css-and-images-showed-up-fine-using-the-development-server-but-they-re-not-displaying-when-using-mod-wsgi\">\n<h2>Τα αρχεία CSS και οι εικόνες δουλεύουν στο admin-site μου χρησιμοποιώντας τον development server, αλλά όχι όταν χρησιμοποιώ το mod_wsgi.<a class=\"heading-anchor\" href=\"#my-admin-site-css-and-images-showed-up-fine-using-the-development-server-but-they-re-not-displaying-when-using-mod-wsgi\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Δείτε στο <a class=\"reference internal\" href=\"/el/5.0/howto/deployment/wsgi/modwsgi/#serving-the-admin-files\"><span class=\"std std-ref\">εξυπηρετώντας τα αρχεία του admin</span></a> μέσα στο εγχειρίδιο «Πως να χρησιμοποιήσω το Django με το mod_wsgi».</p>\n</section>\n<section id=\"my-list-filter-contains-a-manytomanyfield-but-the-filter-doesn-t-display\">\n<h2>Η επιλογή «list_filter» περιέχει ένα πεδίο τύπου ManyToManyField, αλλά το φίλτρο δεν εμφανίζεται.<a class=\"heading-anchor\" href=\"#my-list-filter-contains-a-manytomanyfield-but-the-filter-doesn-t-display\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django won’t bother displaying the filter for a <code class=\"docutils literal notranslate\"><span class=\"pre\">ManyToManyField</span></code> if there\nare no related objects.</p>\n<p>For example, if your <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter\" title=\"django.contrib.admin.ModelAdmin.list_filter\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">list_filter</span></code></a>\nincludes <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/sites/\"><span class=\"doc\">sites</span></a>, and there are no sites in your\ndatabase, it won’t display a «Site» filter. In that case, filtering by site\nwould be meaningless.</p>\n</section>\n<section id=\"some-objects-aren-t-appearing-in-the-admin\">\n<h2>Μερικά objects δεν εμφανίζονται στο admin.<a class=\"heading-anchor\" href=\"#some-objects-aren-t-appearing-in-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Inconsistent row counts may be caused by missing foreign key values or a\nforeign key field incorrectly set to <a class=\"reference internal\" href=\"/el/5.0/ref/models/fields/#django.db.models.Field.null\" title=\"django.db.models.Field.null\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">null=False</span></code></a>. If you have a record with a\n<a class=\"reference internal\" href=\"/el/5.0/ref/models/fields/#django.db.models.ForeignKey\" title=\"django.db.models.ForeignKey\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">ForeignKey</span></code></a> pointing to a nonexistent object and\nthat foreign key is included is\n<a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display\" title=\"django.contrib.admin.ModelAdmin.list_display\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">list_display</span></code></a>, the record will not be\nshown in the admin changelist because the Django model is declaring an\nintegrity constraint that is not implemented at the database level.</p>\n</section>\n<section id=\"how-can-i-customize-the-functionality-of-the-admin-interface\">\n<h2>Πως μπορώ να παραμετροποιήσω τη λειτουργία του admin interface;<a class=\"heading-anchor\" href=\"#how-can-i-customize-the-functionality-of-the-admin-interface\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Έχετε πολλές επιλογές. Αν θέλετε να ενεργήσετε πάνω στη φόρμα προσθήκη/αλλαγή που το Django δημιουργεί αυτόματα, μπορείτε να εφαρμόσετε δικά σας JavaScript modules στη σελίδα, μέσω της παραμέτρου <a class=\"reference internal\" href=\"/el/5.0/ref/contrib/admin/#modeladmin-asset-definitions\"><span class=\"std std-ref\">js parameter</span></a> της κλάσης Admin του μοντέλου. Αυτή η παράμετρος είναι στην ουσία μια λίστα με URLs, σαν strings, τα οποία δείχνουν σε JavaScript modules τα οποία θα συμπεριληφθούν στην φόρμα του admin μέσω του tag <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;script&gt;</span></code>.</p>\n<p>If you want more flexibility than is feasible by tweaking the auto-generated\nforms, feel free to write custom views for the admin. The admin is powered by\nDjango itself, and you can write custom views that hook into the authentication\nsystem, check permissions and do whatever else they need to do.</p>\n<p>Αν θέλετε να αλλάξετε την εμφάνιση του, διαβάστε την επόμενη ερώτηση.</p>\n</section>\n<section id=\"the-dynamically-generated-admin-site-is-ugly-how-can-i-change-it\">\n<h2>Το δυναμικά παραγόμενο admin site είναι άσχημο! Πως μπορώ να το αλλάξω;<a class=\"heading-anchor\" href=\"#the-dynamically-generated-admin-site-is-ugly-how-can-i-change-it\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Μας αρέσει, αλλά αν διαφωνείτε, μπορείτε να αλλάξετε την εμφάνιση του επεξεργάζοντας τα αρχεία CSS και/ή τις εικόνες. Το site χτίστηκε χρησιμοποιώντας semantic HTML και πολλά CSS hooks κάτι το οποίο σημαίνει ότι όποιες αλλαγές θελήσετε να κάνετε δεν έχετε παρά να επεξεργαστείτε τα αρχεία CSS.</p>\n</section>\n<section id=\"what-browsers-are-supported-for-using-the-admin\">\n<span id=\"admin-browser-support\"></span><h2>Ποιους browsers υποστηρίζει το admin;<a class=\"heading-anchor\" href=\"#what-browsers-are-supported-for-using-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The admin provides a fully-functional experience to the recent versions of\nmodern, web standards compliant browsers. On desktop this means Chrome, Edge,\nFirefox, Opera, Safari, and others.</p>\n<p>On mobile and tablet devices, the admin provides a responsive experience for\nweb standards compliant browsers. This includes the major browsers on both\nAndroid and iOS.</p>\n<p>Depending on feature support, there <em>may</em> be minor stylistic differences\nbetween browsers. These are considered acceptable variations in rendering.</p>\n</section>\n<section id=\"what-assistive-technologies-are-supported-for-using-the-admin\">\n<h2>What assistive technologies are supported for using the admin?<a class=\"heading-anchor\" href=\"#what-assistive-technologies-are-supported-for-using-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The admin is intended to be compatible with a wide range of assistive\ntechnologies, but there are currently many blockers. The support target is all\nlatest versions of major assistive technologies, including Dragon, JAWS, NVDA,\nOrca, TalkBack, Voice Control, VoiceOver iOS, VoiceOver macOS, Windows Contrast\nThemes, ZoomText, and screen magnifiers.</p>\n</section>","rootId":"faq-the-admin","toc":[{"title":"Δε μπορώ να συνδεθώ. Όταν εισάγω τα σωστά username και password, επαναφορτώνεται η ίδια login σελίδα, χωρίς μηνύματα σφάλματος.","anchor":"i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-just-brings-up-the-login-page-again-with-no-error-messages","children":[]},{"title":"Δε μπορώ να συνδεθώ. Όταν εισάγω τα σωστά username και password, επαναφορτώνεται η ίδια login σελίδα, με ένα σφάλμα που λέει «Παρακαλώ εισάγετε το σωστό username και κωδικό».","anchor":"i-can-t-log-in-when-i-enter-a-valid-username-and-password-it-brings-up-the-login-page-again-with-a-please-enter-a-correct-username-and-password-error","children":[]},{"title":"Πως μπορώ να σετάρω μια τιμή ενός πεδίου πάνω στον χρήστη που αλληλεπίδρασε τελευταίος με κάποιο object μέσω του admin;","anchor":"how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin","children":[]},{"title":"Πως μπορώ να περιορίσω την πρόσβαση στο admin site ούτως ώστε τα objects να τα επεξεργάζονται μόνο οι χρήστες που τα δημιούργησαν;","anchor":"how-do-i-limit-admin-access-so-that-objects-can-only-be-edited-by-the-users-who-created-them","children":[]},{"title":"Τα αρχεία CSS και οι εικόνες δουλεύουν στο admin-site μου χρησιμοποιώντας τον development server, αλλά όχι όταν χρησιμοποιώ το mod_wsgi.","anchor":"my-admin-site-css-and-images-showed-up-fine-using-the-development-server-but-they-re-not-displaying-when-using-mod-wsgi","children":[]},{"title":"Η επιλογή «list_filter» περιέχει ένα πεδίο τύπου ManyToManyField, αλλά το φίλτρο δεν εμφανίζεται.","anchor":"my-list-filter-contains-a-manytomanyfield-but-the-filter-doesn-t-display","children":[]},{"title":"Μερικά objects δεν εμφανίζονται στο admin.","anchor":"some-objects-aren-t-appearing-in-the-admin","children":[]},{"title":"Πως μπορώ να παραμετροποιήσω τη λειτουργία του admin interface;","anchor":"how-can-i-customize-the-functionality-of-the-admin-interface","children":[]},{"title":"Το δυναμικά παραγόμενο admin site είναι άσχημο! Πως μπορώ να το αλλάξω;","anchor":"the-dynamically-generated-admin-site-is-ugly-how-can-i-change-it","children":[]},{"title":"Ποιους browsers υποστηρίζει το admin;","anchor":"what-browsers-are-supported-for-using-the-admin","children":[]},{"title":"What assistive technologies are supported for using the admin?","anchor":"what-assistive-technologies-are-supported-for-using-the-admin","children":[]}],"breadcrumbs":[{"docname":"faq/index","title":"Συχνές Ερωτήσεις για το Django","url":"/el/5.0/faq/"}],"prev":{"docname":"faq/models","title":"Συχνές Ερωτήσεις: Βάσεις δεδομένων και Μοντέλα","url":"/el/5.0/faq/models/"},"next":{"docname":"faq/contributing","title":"Συχνές Ερωτήσεις: Συνεισφέροντας κώδικα","url":"/el/5.0/faq/contributing/"},"formats":{"html":"/el/5.0/faq/admin/","markdown":"/el/5.0/faq/admin.md","json":"/el/5.0/faq/admin.json"},"source":"https://github.com/django/django/blob/stable/5.0.x/docs/faq/admin.txt","official":"https://docs.djangoproject.com/el/5.0/faq/admin/","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"]}