Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (setq python-shell-interpreter "python"
- python-shell-interpreter-args "-i /absolute/path/to/manage.py shell_plus")
- (defun start-my-ipython-term ()
- (interactive)
- (ansi-term "/usr/bin/ipython"))
- (global-set-key (kbd "<your keybinding here>") 'start-my-ipython-term)
- #!/bin/sh
- set -e
- /bin/echo -n "Select Django project/dir, or press enter for plain ipython: "
- read selection
- case $selection in
- '') exec ipython ;;
- project) cd /Users/japhy/Projekty/some/project/dir ;;
- # other often used projects go here
- *) cd $selection ;;
- esac
- exec python manage.py shell
- #!/bin/sh
- set -e
- /bin/echo -n "Select Django project/dir, or press enter for plain ipython: "
- read selection
- case $selection in
- '') exec ipython ;;
- project) cd /Users/japhy/Projekty/some/project/dir ;;
- # other often used projects go here
- *) cd $selection ;;
- esac
- exec python manage.py shell
- ((python-mode
- (python-shell-interpreter . "python")
- (python-shell-interpreter-args . "/home/youruser/code/yourproject/manage.py shell")
- (python-shell-prompt-regexp . "In \[[0-9]+\]: ")
- (python-shell-prompt-output-regexp . "Out\[[0-9]+\]: ")
- (python-shell-completion-setup-code . "from IPython.core.completerlib import module_completion")
- (python-shell-completion-module-string-code . "';'.join(module_completion('''%s'''))n")
- (python-shell-completion-string-code . "';'.join(get_ipython().Completer.all_completions('''%s'''))n")
- (python-shell-extra-pythonpaths "/home/youruser/code/yourproject/apps/")
- (python-shell-virtualenv-path . "/home/youruser/.virtualenvs/yourproject")))
- M-x shell
- prompt> cd path/to/my/django/directory
- prompt> python manage.py shell
- Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
- [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- (InteractiveConsole)
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement