<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Ciao, io per lo sviluppo quindi per le mie provine per creare gli
esempi da mettere nelle mie guide su Djngo 2, uso le estensioni di
Django.</p>
<p> </p>
<p style="margin-bottom: 0cm; line-height: 100%">La libreria Django
Extensions offre alcuni utili comandi aggiuntivi che il tuo
progetto potrebbe utilizzare.</p>
<p style="margin-bottom: 0cm; line-height: 100%">Io solitamente
installo quanto segue:</p>
<p style="margin-bottom: 0cm; line-height: 100%"> </p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ pipenv install django-extensions</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ pipenv install pydotplus # per graph_models</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ pipenv install ipython # per shell_plus</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ pipenv install werkzeug # per runserver_plus</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ <span style="font-style: normal">sudo apt install graphviz #
installare a livello di sistema</span></p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"><br>
<span style="font-style: normal"> </span></p>
<p style="margin-bottom: 0cm; line-height: 100%">Devi aggiungere poi
la libreria in INSTALLED_APPS:</p>
<p style="margin-bottom: 0cm; line-height: 100%"><br>
</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent; page-break-before: auto">
INSTALLED_APPS = [</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.admin',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.auth',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.contenttypes',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.sessions',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.messages',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'django.contrib.staticfiles',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> 'webpack_loader',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"> '<i>django_extensions</i>',</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">....,<br>
</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
]</p>
<p style="margin-left: 1.5cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
<br>
</p>
<p style="margin-bottom: 0cm; line-height: 100%; background:
transparent">
Una volta fatto ciò, dovresti essere in grado di vedere, tra i
comandi standard, anche i nuovi comandi:</p>
<p style="margin-bottom: 0cm; line-height: 100%; background:
transparent">
<br>
</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">
$ ./manage.py</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">Ti fa vedere tutti i nuovi comandi
disponibili oltre quelli standard.</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">Ciao</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent">Franky<br>
</p>
<p style="margin-left: 1cm; margin-bottom: 0cm; line-height: 100%;
background: transparent"><span style="font-style: normal">
<style type="text/css">p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }</style></span></p>
<p style="margin-bottom: 0cm; line-height: 100%">
<style type="text/css">p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }</style></p>
<p>
<style type="text/css">p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }</style></p>
<div class="moz-cite-prefix">Il 02/05/19 11:11, Luca ha scritto:<br>
</div>
<blockquote type="cite"
cite="mid:CAK62PPRK-aU_2-zj4VmM4Z89U44AuKRqiKENtnc=8_pHCS1aGw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr"><br>
<div dir="auto">
<div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
stdout è una instanza di<br>
<a
href="https://docs.python.org/3/library/io.html#io.TextIOWrapper"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://docs.python.org/3/library/io.html#io.TextIOWrapper</a>.<br>
Quello che puoi fare è creare un nuovo comando che
deriva da<br>
runserver.Command, e nel suo costruttore passare alla
classe base il<br>
parametro stdout con il buffering disabilitato.<br>
<br>
</blockquote>
<div>io pensavo di armeggiare più semplicemente con
settings.py e un mio logger.</div>
<div>Ad ogni modo ci ripenso dopo il pycon.</div>
<div>intanto ti ringrazio</div>
<div><br>
</div>
<div>-- <br>
</div>
<div><br>
</div>
<div>Luca<br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python@lists.python.it">Python@lists.python.it</a>
<a class="moz-txt-link-freetext" href="https://lists.python.it/mailman/listinfo/python">https://lists.python.it/mailman/listinfo/python</a>
</pre>
</blockquote>
</body>
</html>