Ticket #11542: bshell.py
| File bshell.py, 419 bytes (added by , 16 years ago) |
|---|
| Line | |
|---|---|
| 1 | import os |
| 2 | from django.core.management.base import NoArgsCommand |
| 3 | from optparse import make_option |
| 4 | |
| 5 | class Command(NoArgsCommand): |
| 6 | help = "Runs the bpython interactive interpreter if it's installed." |
| 7 | requires_model_validation = False |
| 8 | |
| 9 | def handle_noargs(self, **options): |
| 10 | from django.db.models.loading import get_models |
| 11 | loaded_models = get_models() |
| 12 | import bpython |
| 13 | bpython.embed() |