Created
February 13, 2013 15:23
-
-
Save swinton/4945349 to your computer and use it in GitHub Desktop.
Ugly way of opening a Django shell via a Vagrant command... there must be a better way?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Vagrant::Config.run do |config| | |
| config.vm.box = "lucid64" | |
| config.vm.box_url = "http://files.vagrantup.com/lucid64.box" | |
| config.vm.host_name = "myvagrantbox" | |
| # etc. | |
| end | |
| class DjangoShellCommand < Vagrant::Command::Base | |
| def execute | |
| # Open the interactive Django shell on the Vagrant box | |
| exec 'ssh -t myvagrantbox "python manage.py shell"' | |
| end | |
| end | |
| Vagrant.commands.register(:shell) { DjangoShellCommand } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More clues, from https://github.com/mitchellh/vagrant/blob/v1.0.6/lib/vagrant/command/ssh.rb