Skip to content

Commit 7a566a1

Browse files
committed
cleanup unsupported platforms and config files
1 parent 39845f7 commit 7a566a1

File tree

8 files changed

+9
-237
lines changed

8 files changed

+9
-237
lines changed

.pydevproject

-11
This file was deleted.

.slugignore

Whitespace-only changes.

Procfile

-2
This file was deleted.

README.md

+9-93
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Daemo - Stanford Crowd Research Collective
22

3-
[![Build Status](https://travis-ci.org/crowdresearch/crowdsource-platform.svg)](https://travis-ci.org/crowdresearch/crowdsource-platform)
43

5-
6-
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+.
75

86
## Setup
97

@@ -12,7 +10,7 @@ This is a Django 1.9 app using a Postgres database 9.4 that can be deployed to H
1210
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)
1311

1412
#### 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:
1614

1715
bash> brew install postgresql
1816
bash> brew services start postgresql
@@ -35,7 +33,7 @@ Create a `local_settings.py` file in the project root folder by copying `local_s
3533
Install [Redis](http://redis.io/download) key-value store used for managing sessions, cache and web-sockets support. To install Redis on a Mac:
3634

3735
bash> brew install redis
38-
bash> brew services start redis
36+
bash> brew services start redis
3937

4038
#### Backend Dependencies
4139
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
6967
bash> npm install -g bower
7068
bash> npm install
7169
bash> bower install
72-
70+
7371
To edit CSS using SASS, install SASS. Assuming you have Rails installed, which it is on every Mac:
7472

7573
bash> sudo gem install sass
@@ -86,118 +84,36 @@ Pep8 styling issues will be identified for any python script modifications and n
8684
Port 8000 is used by default. If it is already in use, please modify it in Gruntfile.js
8785

8886
bash> grunt serve
89-
87+
9088
#### uWSGI and Web-Sockets Support
9189
Create a `uwsgi-dev.ini` file in the project root folder by copying `uwsgi-dev-default.ini`
9290
If there are no errors, you are ready to run the app from your local server instead of the ```runserver``` command above:
9391

9492
bash> uwsgi uwsgi-dev.ini
9593

9694
#### HTTPS mode
97-
To serve the local site over https, a sample certificate and key are provided in the repo.
9895
To start it, first disable http mode in `uwsgi-dev.ini` by adding `;` in front of
99-
96+
10097
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+
106100
Unfortunately macOS got rid of the openSSL certificates needed for HTTPS, so you need to recompile the uwsgi with them included:
107101

108102
cd /usr/local/include
109103
ln -s ../opt/openssl/include/openssl .
110104
pip uninstall gevent uwsgi
111105
pip install gevent
112106
C_INCLUDE_PATH=/usr/local/opt/openssl/include LIBRARY_PATH=/usr/local/opt/openssl/lib/ pip install uwsgi --no-binary :all:
113-
107+
114108
Now, ``cd`` back to the main directory and use this command instead of the ```runserver``` command above:
115109

116110
bash> uwsgi uwsgi-dev.ini -H /path/to/your/virtualenv
117111

118112
This uses the ```uwsgi``` server, which is used in production as well.
119113

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

124115
#### Background Jobs with Celery
125116
To run celery locally: `celery -A csp worker -l info -B`
126117

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).
135-
136-
Clone this repo to get the code:
137-
138-
git clone https://github.com/crowdresearch/crowdsource-platform.git
139-
cd crowdsource-platform
140-
141-
Then run the command:
142-
143-
vagrant up
144-
145-
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:
170-
171-
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-python.git
172-
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-nodejs.git
173-
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-pgbouncer
174-
175-
To verify build-packs are setup correctly, execute below replacing <app-name>:
176-
177-
heroku buildpacks --app <app-name>
178-
179-
This should output build-pack URLs as below in same order (nodejs should appear first compared to python):
180-
181-
=== Buildpack URLs
182-
1. https://github.com/heroku/heroku-buildpack-pgbouncer.git
183-
2. https://github.com/heroku/heroku-buildpack-nodejs.git
184-
3. https://github.com/heroku/heroku-buildpack-python.git
185-
186-
Make sure you have Heroku-Postgres and Heroku-Redis Add-ons installed on the instance.
187-
188-
Use this command to deploy your branch to that instance.
189-
190-
git push heroku yourbranch:master
191-
192-
For setting environ variables, use below
193-
194-
heroku config:set <variable>=<value>
195-
196-
For instance, to enable Registration,
197-
198-
heroku config:set REGISTRATION_ALLOWED=True
199118

200-
and to disable Registration,
201119

202-
heroku config:unset REGISTRATION_ALLOWED
203-

Vagrantfile

-99
This file was deleted.

runtime.txt

-1
This file was deleted.

vassals/webserver.ini

-16
This file was deleted.

vassals/websockets.ini

-15
This file was deleted.

0 commit comments

Comments
 (0)