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
0201b9d6
Kaydet (Commit)
0201b9d6
authored
Şub 09, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19749 -- Documented ending param to command's self.stdout/err
Thanks xian at mintchaos.com for the report.
üst
f44922c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
custom-management-commands.txt
docs/howto/custom-management-commands.txt
+7
-1
1.5.txt
docs/releases/1.5.txt
+5
-0
No files found.
docs/howto/custom-management-commands.txt
Dosyayı görüntüle @
0201b9d6
...
...
@@ -65,12 +65,18 @@ look like this:
self.stdout.write('Successfully closed poll "%s"' % poll_id)
.. _management-commands-output:
.. note::
When you are using management commands and wish to provide console
output, you should write to ``self.stdout`` and ``self.stderr``,
instead of printing to ``stdout`` and ``stderr`` directly. By
using these proxies, it becomes much easier to test your custom
command.
command. Note also that you don't need to end messages with a newline
character, it will be added automatically, unless you specify the ``ending``
parameter::
self.stdout.write("Unterminated line", ending='')
The new custom command can be called using ``python manage.py closepoll
<poll_id>``.
...
...
docs/releases/1.5.txt
Dosyayı görüntüle @
0201b9d6
...
...
@@ -253,6 +253,11 @@ Django 1.5 also includes several smaller improvements worth noting:
from :ref:`call_command <call-command>`. Any exception raised by the command
(mostly :ref:`CommandError <ref-command-exceptions>`) is propagated.
Moreover, when you output errors or messages in your custom commands, you
should now use ``self.stdout.write('message')`` and
``self.stderr.write('error')`` (see the note on
:ref:`management commands output <management-commands-output>`).
* The dumpdata management command outputs one row at a time, preventing
out-of-memory errors when dumping large datasets.
...
...
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