Esecuzione di un interprete python pianura presense di ipython con le coperture manage.py

StackOverflow https://stackoverflow.com/questions/1295492

  •  18-09-2019
  •  | 
  •  

Domanda

Ho ipython installato, voglio correre un interprete python normale invece con le coperture manage.py.

Così provo,

python2.5 manage.py shell --plain

che mi ha dato un errore, e il testo che suggeriscono che --plain è stato passato al ipython

Così ho letto, http://docs.djangoproject.com/ it / dev / ref / django-admin /

che suggets

django-admin.py shell --plain

Il che mi dà

Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Il che sembra la cosa giusta per poter fare.

Che cosa sto Mising qui? [Ubuntu Jaunty, django.VERSION = (1, 2, 0, 'alfa', 0), pitone 2.5 e 2.6]

È stato utile?

Soluzione

Se il motivo che si desidera utilizzare interprete di Python oltre ipython di è perché è necessario incollare i test doc, si può provare a digitare

%doctest_mode

nella console ipython invece

In [1]: %doctest_mode
*** Pasting of code with ">>>" or "..." has been enabled.
Exception reporting mode: Plain
Doctest mode is: ON
>>> 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top