Merge branch 'master' of github.com:loleg/public-health-ch into frontpage-initial

This commit is contained in:
Oleg Lavrovsky 2017-01-10 16:27:11 +01:00
commit 5d31c03447
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 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.

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