Coder Social home page Coder Social logo

online-study-game's Introduction

Online-Study-Game

This repository contains code for running the invest_game study and supporting questionnaires. It also contains (deprecated!) non-invest_game code designed to run other game experiments. This functionality is siloed in its own Django app but could be restored in the future.

Setting up a local environment

This application uses virtualenv to manage the local development environment. Follow the steps below to set up your environment:

  1. If you do not have pip installed, follow the instructions here.
  2. Install virtualenv: pip3 install virtualenv
  3. Set up you virtual environment. From the root directory of this repository, run:
virtualenv --python=$(which python3) env
  1. Enter your new virtual environment: source ./env/bin/activate
  2. Install dependencies: pip install -r requirements.txt
  3. If running the app for the first time, build the database: python manage.py migrate

In development, we use sqlite as the database backend for convenience. In production, we use Postgres.

Running the development server

Start Django's development server with the following command:

python manage.py runserver

You can then run the application at localhost:8000?id=<some_id>.

Cleaning up

To leave your virtual environment when you've finished working on the project, run: deactivate.

Deployment

The application is configured to be deployed to an Elastic Beanstalk environment in AWS. This readme assumes that the EB environment is already set up. The environment should have a Postgres database instance connected to it, and should define the following environment variables:

ADMIN_PASSWORD=<chosen_admin_panel_password>
ADMIN_USERNAME=<chosen_admin_panel_username>
DEBUG=False
DJANGO_SETTINGS_MODULE=config.settings

Assuming such an environment exists, the application can be deployed by running:

eb deploy <environment_name>

where <environment_name> is the name of the EB environment. If no <environment_name> is supplied, the deployment will default to an environment called Online-Study-Game. It's intended that the default environment name be used for the production application.

If you need to create an environment, use the eb create command, documented here.

Admin panel

The standard Django admin application can be accessed at <application_url>/admin. The username and password are set using the ADMIN_USERNAME and ADMIN_PASSWORD environment variables.

From the admin panel, you can export study data to a CSV file.

Running tests

Run tests with:

python manage.py test

online-study-game's People

Contributors

goldpbear avatar wzrumich avatar mlhess avatar nanjers123 avatar

Watchers

James Cloos 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.