From 04e5106df48adc92e8328f1c7cad7a5a038d0db6 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 14 Dec 2016 10:43:06 +0100 Subject: [PATCH] Vagrant provisioning and README --- readme.md | 28 +++++++++++++++++++++++++--- vagrant/provision.sh | 8 ++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 7d4b968..e17b97f 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,15 @@ Website of the Swiss Society for Public Health ## Development environment -Backend setup +The easiest way to set up your machine would be to use [Vagrant](https://vagrantup.com), then in the project folder in the terminal type: + +``` +vagrant liverun +``` + +**Backend setup** + +After installing Python 3, from the project folder: ``` sudo apt-get install python3-venv python3-dev @@ -17,13 +25,27 @@ pip install -r requirements.txt ./manage.py migrate ./manage.py createsuperuser -./manage.py runserver ``` -Frontend setup +You will be asked a few questions to create an administrator account. + +**Frontend setup** + +Make sure a recent version of node.js is installed, then: ``` npm install +npm install -g bower grunt-cli bower install +``` + +**Starting up** + +Run this after completing setup: + +``` +./manage.py runserver grunt browser-sync ``` + +If you have one installed, also start your local redis server. diff --git a/vagrant/provision.sh b/vagrant/provision.sh index 3cc2d46..d850800 100755 --- a/vagrant/provision.sh +++ b/vagrant/provision.sh @@ -42,10 +42,18 @@ cat << EOF >> /home/vagrant/.bashrc export PYTHONPATH=$PROJECT_DIR export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev + alias dj="django-admin.py" alias djrun="dj runserver 0.0.0.0:8000" source $VIRTUALENV_DIR/bin/activate export PS1="[$PROJECT_NAME \W]\\$ " cd $PROJECT_DIR + +# Install Frontend dependencies +npm install -g bower grunt-cli +npm install +bower install +alias liverun="grunt browser-sync" + EOF