1

I am using ADL LRS to setup a LRS(Learning Record Store) system for my own use. It uses TIN CAN API. I am using ubuntu server

As the documentation states, For the setup of LRS, I need to install django adn set it up for LRS. The adl_lrs folder inside the ADL_LRS contains the setting file for django(settings.py). I am bit new to django, so I can not fully understand the meaning of this part of the file-

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = '/var/www/adllrs/media/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://my-site-name.com/media/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

It states- 1. MEDIA_ROOT = '/var/www/adllrs/media/' which I assume it means is to put the media files like songs and videos, at this location 2. STATIC_ROOT = '' which I assumes means the path of the static directory which contains the HTML, CSS, js files.

On cloning the git, I setup the LRS, which by the way started but all the CSS broken. I looked into DOM inspector, where the link of CSS files are like-

http://my-site-name.com:8000/static/admin/css/base.css

When I visited the above url to see what's happening, I got following output as HTML(same as I get when visiting homepage, i.e http://my-site-name.com:8000)-

Page not found (404)
Request Method:     GET
Request URL:    http://my-site-name.com:8000/

    Using the URLconf defined in adl_lrs.urls, Django tried these URL patterns, in this order:

        ^XAPI/
        ^xapi/
        ^admin/

    The current URL, , didn't match any of these.

My urls.py looks like-

url(r'^XAPI/', include('lrs.urls')),
url(r'^xapi/', include('lrs.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls))

Obviously I am not mentioning my home page in the urls.py which point to the error. So where should I put the CSS,JS files to get the broken CSS fixed and make a default home page for this? and also I have tried to send tin can statements from wordpress, but I could not get the statements on my server. can anyone tell me how to setup a proper ADL LRS on ubuntu.

PS- Do not tell me to read the documentation as I have done it like dozen times. Tell me where I am wrong in implementing the documentation.

ashutosh
  • 1,192
  • 5
  • 22
  • 46

1 Answers1

1

It sounds like you have the LRS running with just gunicorn. gunicorn by itself doesn't serve static files like the JS and CSS. I found another SO page talking about serving static files with gunicorn: https://stackoverflow.com/a/12801140/1187723

As for the LRS, when I am developing and testing locally I run Django's test server, which will deliver static files. From the project's root directory ADL_LRS, start it with python manage.py runserver. https://docs.djangoproject.com/en/1.4/ref/django-admin/#runserver-port-or-address-port

When we deploy the LRS at https://lrs.adlnet.gov/xapi/ we use nginx, which is configured to serve the static files. We have some initial set up stuff about it at https://github.com/adlnet/ADL_LRS/wiki/Using-Nginx-for-Production

Community
  • 1
  • 1
tom creighton
  • 477
  • 4
  • 10