Vagrant provisioning and README

This commit is contained in:
Oleg Lavrovsky 2016-12-14 10:43:06 +01:00
parent 9db87c162b
commit 04e5106df4
2 changed files with 33 additions and 3 deletions

View file

@ -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.

View file

@ -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