Issue
I've got a Django product I'm using iPython to interact with.
I'm trying to have modules automatically loaded when I start a shell:
python manage.py shell
I've copied .ipython/ipythonrc to the root directory of the project and added to the file:
import_some module_name model1 model2
However, when I start the shell, these names are not being loaded.
What am I doing wrong?
Solution
I don't know about ipythonrc, but if you only need the models, you could use django-extensions
. After you install it, you've got a plethora of new managment commands, including shell_plus
, which will open a ipython session and autoload all your models:
python manage.py shell_plus
Answered By - Benjamin Wohlwend
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.