Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. # Use `ipython` shell with Django
  2. Ordinary Django shell
  3.  
  4. ```bash
  5. $ python manage.py shell
  6. ```
  7. does not do autocompletion, doc pretty-printing or other nice-to-have-things.
  8.  
  9. A way around this is using the `ipython` shell.
  10. We'll assume that both `django` and `ipython` are installed (in an active `virtualenv`),
  11. and that the django project in question is called `mysite` (e.g. made via `$ django-admin startproject mysite`).
  12.  
  13. 1st set up the environment:
  14.  
  15. ```bash
  16. $ export DJANGO_SETTINGS_MODULE=mysite.settings
  17. ```
  18. then launch `ipython` and wire in django:
  19.  
  20. ```ipython
  21. In [1]: import django
  22. In [2]: django.setup()
  23. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement