Vagrant provisioning and README
This commit is contained in:
parent
9db87c162b
commit
04e5106df4
2 changed files with 33 additions and 3 deletions
28
readme.md
28
readme.md
|
@ -5,7 +5,15 @@ Website of the Swiss Society for Public Health
|
||||||
|
|
||||||
## Development environment
|
## 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
|
sudo apt-get install python3-venv python3-dev
|
||||||
|
@ -17,13 +25,27 @@ pip install -r requirements.txt
|
||||||
|
|
||||||
./manage.py migrate
|
./manage.py migrate
|
||||||
./manage.py createsuperuser
|
./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
|
||||||
|
npm install -g bower grunt-cli
|
||||||
bower install
|
bower install
|
||||||
|
```
|
||||||
|
|
||||||
|
**Starting up**
|
||||||
|
|
||||||
|
Run this after completing setup:
|
||||||
|
|
||||||
|
```
|
||||||
|
./manage.py runserver
|
||||||
grunt browser-sync
|
grunt browser-sync
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you have one installed, also start your local redis server.
|
||||||
|
|
|
@ -42,10 +42,18 @@ cat << EOF >> /home/vagrant/.bashrc
|
||||||
export PYTHONPATH=$PROJECT_DIR
|
export PYTHONPATH=$PROJECT_DIR
|
||||||
export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev
|
export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev
|
||||||
|
|
||||||
|
|
||||||
alias dj="django-admin.py"
|
alias dj="django-admin.py"
|
||||||
alias djrun="dj runserver 0.0.0.0:8000"
|
alias djrun="dj runserver 0.0.0.0:8000"
|
||||||
|
|
||||||
source $VIRTUALENV_DIR/bin/activate
|
source $VIRTUALENV_DIR/bin/activate
|
||||||
export PS1="[$PROJECT_NAME \W]\\$ "
|
export PS1="[$PROJECT_NAME \W]\\$ "
|
||||||
cd $PROJECT_DIR
|
cd $PROJECT_DIR
|
||||||
|
|
||||||
|
# Install Frontend dependencies
|
||||||
|
npm install -g bower grunt-cli
|
||||||
|
npm install
|
||||||
|
bower install
|
||||||
|
alias liverun="grunt browser-sync"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in a new issue