Giter Site home page Giter Site logo

niyikai / adl_lrs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adlnet/adl_lrs

0.0 1.0 0.0 4.71 MB

ADL's Open Source Learning Record Store (LRS) is used to store learning data collected with the Experience API.

License: Apache License 2.0

Python 96.62% CSS 0.40% HTML 2.97%

adl_lrs's Introduction

ADL LRS

Installation tested on Ubuntu 12.10 machine with Python 2.7.3. Should be good with Ubuntu 10.04 LTS - 13.04 releases. Updated to be compliant with the 1.0.1 xAPI spec.

This version is stable, but only intended to support a small amount of users as a proof of concept. While it uses programming best practices, it is not designed to take the place of an enterprise system.

Installation

Install Prerequisites

admin:~$ sudo apt-get install git fabric postgresql python-setuptools \
	postgresql-server-dev-all python-dev libxml2-dev libxslt-dev
admin:~$ sudo easy_install pip
admin:~$ sudo pip install virtualenv

Create ADL LRS system user

admin:~$ sudo useradd -c "ADL Learning Record Store System" -m -s "/bin/bash" <db_owner>

Setup Postgres

admin:~$ sudo -u postgres createuser -P <db_owner>
Enter password for new role: *****
Enter it again: *****
Shall the new role be a superuser? (y/n) y
admin:~$ sudo -u postgres psql template1
template1=# CREATE DATABASE lrs OWNER <db_owner>;
template1=# \q (exits shell)

Clone the LRS repository

admin:~$ sudo su <db_owner>
dbowner:~$ mkdir <dir_name>
dbowner:~$ git clone https://github.com/adlnet/ADL_LRS.git <dir_name>/
dbowner:~$ cd <dir_name>/ADL_LRS

Set the LRS configuration

### File: ADL_LRS/adl_lrs/settings.py

# configure the database
DATABASES = {
	'default': {
	    'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'lrs',
        'USER': '<db_owner>',
        'PASSWORD': 'password',   # Comment out these lines if
        'HOST': 'localhost',      # using postgresql "peer" auth.
        'PORT': '',               # See pg_hba.conf for details
    }
}

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'Some long random string with numb3rs and $ymbol$'

# set to 'https' if using SSL encryption
SITE_SCHEME = 'http'

Setup the environment

dbowner:ADL_LRS$ fab setup_env
...
dbowner:ADL_LRS$ source ../env/bin/activate
(env)dbowner:ADL_LRS$

Setup the LRS

(env)dbowner:ADL_LRS$ fab setup_lrs
...
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use '<db_owner>'): 
E-mail address:
Password: 
Password (again): 
Superuser created successfully.
...

If you get some sort of authentication error here, make sure that Django and PostgreSQL are both using the same form of authentication (adl_lrs/settings.py and pg_hba.conf) and that the credentials given in settings.py are the same as those you created.

Starting

While still in the ADL_LRS directory, run

(env)dbowner:ADL_LRS$ supervisord

To verify it's running

(env)dbowner:ADL_LRS$ supervisorctl

Set your site domain

Visit the admin section of your website (/admin). Click Sites and you'll see the only entry is 'example.com' (The key for this in the DB is 1 and it maps back to the SITE_ID value in settings). Change the domain and name to the domain you're going to use. If running locally it could be localhost:8000, or if production could be lrs.adlnet.gov (DON'T include the scheme here, that should be set in settings.py already). Sync your database again to apply the change

(env)dbowner:ADL_LRS$ python manage.py syncdb

Whenever you want to exit the virtual environment, just type deactivate

You should see a task named web running. This will host the application using gunicorn with 2 worker processes. If you open a browser and visit http://localhost:8000/xapi you will hit the LRS. Gunicorn does not serve static files so no CSS will be present. This is fine if you're doing testing/development but if you want to host a production-ready LRS, Nginx needs to be setup to serve static files. For more production-like environments, we also recommend using uWSGI instead of Gunicorn. Please read these instructions for including Nginx and using uWSGI intead of Gunicorn. For a more detailed description of the tools being used in general, visit here. Additionally if you're just doing dev, instead of using supervisor you can just run python manage.py runserver and use Django's built-in web server.

Test LRS

(env)dbowner:ADL_LRS$ fab test_lrs

Helpful Information

License

Copyright ©2015 Advanced Distributed Learning

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

adl_lrs's People

Contributors

creighton avatar ljwolford avatar wegrata avatar ottenhoff avatar

Watchers

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