-
Notifications
You must be signed in to change notification settings - Fork 6
/
INSTALL.txt
67 lines (47 loc) · 2.33 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Install python 2.7, virtualenv, postgres.
```
createdb opendebates
virtualenv --python=python2.7 ve
./ve/bin/pip install -r requirements.txt
./ve/bin/python opendebates/manage.py syncdb
```
Then you can start the development server:
```
./ve/bin/python opendebates/manage.py runserver 0.0.0.0:8000
```
Deployment-specific environment variables can be stored in a `opendebates/.env` file.
See `opendebates/.env.sample` for relevant variables that you might want to set.
To collect static files:
```
./ve/bin/python opendebates/manage.py collectstatic --noinput
```
Files will be collected into `opendebates/static/` -- in production mode (DJANGO_DEBUG=False)
all static files will be served from this directory. Do not make edits to files directly
in `opendebates/static` -- instead, make edits to the source files and then re-run collectstatic
to update the served copies.
## Using Vagrant to create dev VM
### Installation
Install virtualbox. This will be fairly OS specific, but we recommend using some package manager (apt/aptitude, rpm, brew, etc). Unless you're on windows, in which case ???
Install vagrant: http://docs.vagrantup.com/v2/installation/index.html
Install vagrant plugin vagrant-ansible-local
vagrant plugin install vagrant-ansible-local
### Setup
All you should need is `vagrant up`. This will bring up a VM with all of the appropriate setup/installation.
In order to get into the VM, you can use `vagrant ssh`. This will log you in as the 'vagrant' user, which has sudo priveleges. If you'd like root, you can use `sudo su -` which will log you in as root. All of the files in repo will be placed in /vagrant.
Therefore, in order to start the webserver, you can do the following:
```
/vagrant/ve/bin/python opendebates/manage.py runserver 0.0.0.0:8000
```
Similarly, to collect static files you can use:
```
/vagrant/ve/bin/python opendebates/manage.py collectstatic --noinput
```
HOWEVER, you don't actually need to ssh into the VM in order to run these commands!
```
vagrant ssh -c '/vagrant/ve/bin/python /vagrant/opendebates/manage.py runserver 0.0.0.0:8000'
```
or
```
vagrant ssh -c '/vagrant/ve/bin/python /vagrant/opendebates/manage.py collectstatic --noinput'
```
You do not need to edit any of the server files in the virtual machine. It is perfectly fine to do all of your normal development work in this repo as you would normally.