You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Django 1.9 app using a Postgres database 9.4 that can be deployed to Heroku.
4
+
This is a Django 1.11 app using a Postgres database 9.5+.
7
5
8
6
## Setup
9
7
@@ -12,7 +10,7 @@ This is a Django 1.9 app using a Postgres database 9.4 that can be deployed to H
12
10
If you are on Windows or want a simpler (automatic) setup process, please try the instructions in the [Setup with Vagrant](#setup-with-vagrant) section. Solutions to common errors can found on the [FAQ page](http://crowdresearch.stanford.edu/w/index.php?title=FAQs)
13
11
14
12
#### Databases
15
-
Install [Postgres](http://postgresapp.com/) 9.4+. If you have a Mac, we recommend using [Homebrew](http://brew.sh/). To install Postgres on a Mac using Homebrew:
13
+
Install [Postgres](http://postgresapp.com/) 9.5+. If you have a Mac, we recommend using [Homebrew](http://brew.sh/). To install Postgres on a Mac using Homebrew:
16
14
17
15
bash> brew install postgresql
18
16
bash> brew services start postgresql
@@ -35,7 +33,7 @@ Create a `local_settings.py` file in the project root folder by copying `local_s
35
33
Install [Redis](http://redis.io/download) key-value store used for managing sessions, cache and web-sockets support. To install Redis on a Mac:
36
34
37
35
bash> brew install redis
38
-
bash> brew services start redis
36
+
bash> brew services start redis
39
37
40
38
#### Backend Dependencies
41
39
Make sure you have [Python](https://www.python.org/downloads/) installed. Test this by opening a command line terminal and typing `python'.
@@ -69,7 +67,7 @@ Now, you can install the dependencies, which are managed by a utility called Bow
69
67
bash> npm install -g bower
70
68
bash> npm install
71
69
bash> bower install
72
-
70
+
73
71
To edit CSS using SASS, install SASS. Assuming you have Rails installed, which it is on every Mac:
74
72
75
73
bash> sudo gem install sass
@@ -86,118 +84,36 @@ Pep8 styling issues will be identified for any python script modifications and n
86
84
Port 8000 is used by default. If it is already in use, please modify it in Gruntfile.js
87
85
88
86
bash> grunt serve
89
-
87
+
90
88
#### uWSGI and Web-Sockets Support
91
89
Create a `uwsgi-dev.ini` file in the project root folder by copying `uwsgi-dev-default.ini`
92
90
If there are no errors, you are ready to run the app from your local server instead of the ```runserver``` command above:
93
91
94
92
bash> uwsgi uwsgi-dev.ini
95
93
96
94
#### HTTPS mode
97
-
To serve the local site over https, a sample certificate and key are provided in the repo.
98
95
To start it, first disable http mode in `uwsgi-dev.ini` by adding `;` in front of
99
-
96
+
100
97
http-socket = :8000
101
-
102
-
Now enable https mode by removing `;` in front of
103
-
104
-
;https = :8000,cacert.pem,private_key.pem,HIGH
105
-
98
+
99
+
106
100
Unfortunately macOS got rid of the openSSL certificates needed for HTTPS, so you need to recompile the uwsgi with them included:
This uses the ```uwsgi``` server, which is used in production as well.
119
113
120
-
And you can visit the website by going to https://127.0.0.1:8000 in your web browser.
121
-
122
-
You will see a untrusted certificate message in most modern browsers. For this site (and this site only), you may ignore this warning and proceed to the site.
123
114
124
115
#### Background Jobs with Celery
125
116
To run celery locally: `celery -A csp worker -l info -B`
126
117
127
-
## Setup with Vagrant
128
-
We do not guarantee that this will work for all machines under Windows, it is up to you to make it work, we highly recommend using Linux or OS X.
129
-
130
-
This approach might be useful if you're on Windows or have trouble setting up postgres, python, nodejs, git, etc. It will run the server in a virtual machine.
131
-
132
-
First install [Virtualbox](https://www.virtualbox.org/) and [Vagrant](https://www.vagrantup.com/).
133
-
134
-
If you are on Windows, you should also install [Git](http://msysgit.github.io/). During the setup process, select "Use Git and optional Unix tools from the Windows Command Prompt" (on the "Adjusting your PATH environment" page), and "Checkout as-is, commit Unix-style line endings" (on the "Configuring the line ending conversions" page).
This will set up an Ubuntu VM, install prerequisites, create databases, and start the machine. Then run:
146
-
147
-
vagrant ssh
148
-
149
-
This will now give you a shell in your virtual machine. It will automatically cd to /home/vagrant/crowdsource-platform where the code is (this is a shared folder with the host machine)
150
-
151
-
Now you can run the server:
152
-
153
-
python manage.py runserver [::]:8000
154
-
155
-
And you can visit the website by going to http://localhost:8000 in your web browser.
156
-
157
-
Refer to HTTPS mode section for running instance in secure mode.
158
-
159
-
On subsequent runs, you only need to run:
160
-
161
-
vagrant up
162
-
vagrant ssh
163
-
python manage.py runserver [::]:8000
164
-
165
-
## Setup with Heroku
166
-
167
-
Every PR should be that does something substantial (i.e. not a README change) must be accompanied with a live demo of the platform. To spin up your own heroku instance, you can sign up for an account for free and follow instructions found [here](https://devcenter.heroku.com/articles/git).
168
-
169
-
After setting up your own heroku instance, setup the build-packs for the instance by executing below commands in same order:
0 commit comments