diff --git a/readme.md b/readme.md index b421cf6..e22c121 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 libjpeg-dev @@ -17,14 +25,28 @@ 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 -g bower grunt-cli 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