GithubHelp home page GithubHelp logo

abodacs / daemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crowdresearch/daemo

1.0 1.0 0.0 34.56 MB

The Daemo crowdsourcing platform

Home Page: https://www.daemo.org

License: MIT License

JavaScript 23.75% Shell 0.06% Python 41.39% CSS 9.55% HTML 25.25%

daemo's Introduction

Daemo - Stanford Crowd Research Collective

This is a Django 1.11 app using a Postgres database 9.5+.

Setup

Please follow the GitHub tutorial to setup the repository.

If you are on Windows or want a simpler (automatic) setup process, please try the instructions in the Setup with Vagrant section. Solutions to common errors can found on the FAQ page

Databases

Install Postgres 9.5+. If you have a Mac, we recommend using Homebrew. To install Postgres on a Mac using Homebrew:

bash> brew install postgresql
bash> brew services start postgresql
bash> createdb

Create a new database:

bash> psql
psql> CREATE DATABASE crowdsource_dev ENCODING 'UTF8';

Create a local_settings.py file in the project root folder by copying local_settings_default.py and configure it to connect to your local Postgres database:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql_psycopg2",
        "NAME": "crowdsource_dev"
    }
}

Install Redis key-value store used for managing sessions, cache and web-sockets support. To install Redis on a Mac:

bash> brew install redis
bash> brew services start redis

Backend Dependencies

Make sure you have Python installed. Test this by opening a command line terminal and typing `python'.

Install virtualenv to manage a local setup of your python packages:

bash> pip install virtualenv

Go into the directory with the checkout of the code and create the Python virtual environment:

bash> virtualenv venv

Source the virtual environment, install dependencies, and migrate the database:

bash> source venv/bin/activate
bash> pip install -r local_requirements.txt
bash> python manage.py migrate

Frontend Dependencies

Install node.js. On a Mac:

bash> brew install node

For Ubuntu or Debian:

bash> sudo apt-get update
bash> sudo apt-get install nodejs nodejs-legacy npm

Now, you can install the dependencies, which are managed by a utility called Bower:

bash> npm install -g bower
bash> npm install
bash> bower install

To edit CSS using SASS, install SASS. Assuming you have Rails installed, which it is on every Mac:

bash> sudo gem install sass

If there are no errors, you are ready to run the app from your local server:

bash> python manage.py runserver

Grunt Toolchain with LiveReload

As an alternative, using grunt toolchain, you can start the server as below. This will auto-compile SCSS using LibSass and reload when changes happen for frontend. For LiveReload, please visit how do I install Live Reload and use the browser extensions for your browser. Pep8 styling issues will be identified for any python script modifications and notified in console. Port 8000 is used by default. If it is already in use, please modify it in Gruntfile.js

bash> grunt serve

uWSGI and Web-Sockets Support

Create a uwsgi-dev.ini file in the project root folder by copying uwsgi-dev-default.ini If there are no errors, you are ready to run the app from your local server instead of the runserver command above:

bash> uwsgi uwsgi-dev.ini

HTTPS mode

To start it, first disable http mode in uwsgi-dev.ini by adding ; in front of

http-socket = :8000

Unfortunately macOS got rid of the openSSL certificates needed for HTTPS, so you need to recompile the uwsgi with them included:

cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
pip uninstall gevent uwsgi
pip install gevent
C_INCLUDE_PATH=/usr/local/opt/openssl/include LIBRARY_PATH=/usr/local/opt/openssl/lib/ pip install uwsgi --no-binary :all:

Now, cd back to the main directory and use this command instead of the runserver command above:

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

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

Background Jobs with Celery

To run celery locally: celery -A csp worker -l info -B

daemo's People

Contributors

abhay-venkatesh avatar aditimithal avatar agarwal22megha avatar ankita2992 avatar arjun-pp avatar arshiya-singh avatar asmitagupta avatar beingcooper avatar curious72 avatar damon-myers avatar dmorina avatar elsabakiu avatar gkovacs avatar jeerel avatar kirmani avatar ksetyadi avatar leek20 avatar macbull avatar maniksingh92 avatar markwhiting avatar mbernst avatar milstein avatar nalinc avatar neilthemathguy avatar nevenwt avatar rns4731 avatar ryosuzuki avatar sehgalvibhor avatar shirishgoyal avatar soroosh129 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.