Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d26207d5
Kaydet (Commit)
d26207d5
authored
Kas 08, 2015
tarafından
Elena Oat
Kaydeden (comit)
Tim Graham
Kas 17, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25526 -- Documented how to output colored text in custom management commands.
üst
0a2d3b73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
custom-management-commands.txt
docs/howto/custom-management-commands.txt
+16
-1
No files found.
docs/howto/custom-management-commands.txt
Dosyayı görüntüle @
d26207d5
...
...
@@ -67,7 +67,7 @@ look like this::
poll.opened = False
poll.save()
self.stdout.write(
'Successfully closed poll "%s"' % poll_id
)
self.stdout.write(
self.style.SUCCESS('Successfully closed poll "%s"' % poll_id)
)
.. _management-commands-output:
...
...
@@ -256,6 +256,21 @@ All attributes can be set in your derived class and can be used in
because attempting to set the locale needs access to settings. This
condition will generate a :class:`CommandError`.
.. attribute:: BaseCommand.style
An instance attribute that helps create colored output when writing to
``stdout`` or ``stderr``. For example::
self.stdout.write(self.style.SUCCESS('...'))
See :ref:`syntax-coloring` to learn how to modify the color palette and to
see the available styles (use uppercased versions of the "roles" described
in that section).
If you pass the :djadminopt:`--no-color` option when running your
command, all ``self.style()`` calls will return the original string
uncolored.
Methods
-------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment