-
Notifications
You must be signed in to change notification settings - Fork 7
New Developers
This page will help you install and configure Vagrant on your local machine for local development.
To get up and running right away without having to install the many dependencies needed to get Local Ground to run, you have the option of creating a Virtual Machine with all of the dependencies defined and configured. Follow these steps:
-
Download VirtualBox for your operating system.
-
Download Vagrant for your operating system.
-
At the command line, clone the Git Repository on your local machine:
git clone https://github.com/LocalGround/localground.git -
Checkout the redesign branch (other branches will soon be deprecated, but master has not yet been updated).
-
Navigate to your Local Ground directory at the command line, and type
vagrant up -
Wait about 45 minutes for Vagrant to configure your new virtual machine instance (which relies on this shell script).
-
Now, open your web browser to http://localhost:7777. Vagrant has been configured to forward all requests to the :7777 port to Apache on your Virtual Server that you just created. You should see a functioning instance of Local Ground operating in your web browser.
-
In the /localground/apps/settings_local.py file, add a valid SendGrid API key and Mapbox API Key (required for you to create new accounts on your local Local Ground instance).
-
Create a command line shortcut to conveniently start the vagrant server as follows:
$ vagrant ssh
$ echo "alias dj='bash -c \"python /localground/apps/manage.py runserver 0.0.0.0:8000\"'" >> .bashrc
$ source .bashrc- start the server:
$ dj- Every time you want to run the server locally, you will have to ssh to your vagrant box and run the "dj" command. You must keep it running as long as you want the server to run:
$ vagrant ssh
$ dj
- With vagrant, you can edit files on your local machine using a text editor of your choice.
- If you edit python files on your local machine, the Django server should start automatically.
- The password for the vagrant user on your VM is also "vagrant"
- If you ssh to your VM instance, all of the source code is located here:
/localground. - If you delete a file in the
/localgrounddirectory of your VM, it will also be deleted on your local machine (and vice versa), as the folder is shared. - Useful Vagrant commands:
- To ssh into your machine using Vagrant, just type "vagrant ssh" at the command line in your localground root folder.
- To pause your vagrant VM, type:
vagrant suspend - To restart your vagrant VM. type:
vagrant up - To reload dependencies / changes to either the Vagrantfile or to the /deploy_tools/bootstrap.sh file, type:
vagrant reload --provision