From e3f31424b3563231b18befdf65248a8282d54291 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Mon, 11 Dec 2017 16:51:34 +0000 Subject: [PATCH] Update the settings to get the vagrant box to run correctly --- README.md | 2 +- Vagrantfile | 2 +- vagrant/provision.sh | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd7a73e54..17e5e6633 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ To set up a new build: ``` bash git clone git@github.com:OpenTechFund/opentech.fund.git -cd opentech +cd opentech.fund vagrant up vagrant ssh ``` diff --git a/Vagrantfile b/Vagrantfile index e628b6d15..adc20908d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -78,7 +78,7 @@ Vagrant.configure(2) do |config| # sudo apt-get update # sudo apt-get install -y apache2 # SHELL - config.vm.provision :shell, :path => "vagrant/provision.sh", :args => "opentech" + config.vm.provision :shell, :path => "vagrant/provision.sh", :args => ["opentech.fund", "opentech"] # Enable agent forwarding over SSH connections. config.ssh.forward_agent = true diff --git a/vagrant/provision.sh b/vagrant/provision.sh index 2778d5047..380720c09 100755 --- a/vagrant/provision.sh +++ b/vagrant/provision.sh @@ -1,6 +1,7 @@ #!/bin/bash PROJECT_NAME=$1 +MODULE_NAME=$2 PROJECT_DIR=/vagrant VIRTUALENV_DIR=/home/vagrant/.virtualenvs/$PROJECT_NAME @@ -10,8 +11,8 @@ PIP=$VIRTUALENV_DIR/bin/pip # Create database -su - vagrant -c "createdb $PROJECT_NAME" +su - vagrant -c "createdb $MODULE_NAME" # Virtualenv setup for project su - vagrant -c "virtualenv --python=python3 $VIRTUALENV_DIR" @@ -40,7 +41,7 @@ chmod a+x $PROJECT_DIR/manage.py # Add a couple of aliases to manage.py into .bashrc cat << EOF >> /home/vagrant/.bashrc export PYTHONPATH=$PROJECT_DIR -export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev +export DJANGO_SETTINGS_MODULE=$MODULE_NAME.settings.dev alias dj="django-admin.py" alias djrun="dj runserver 0.0.0.0:8000" -- GitLab