Skip to content

uid/learnersourcing-subgoal-labels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

learnersourcing-subgoal-labels

Project and files

  • learnersourcing: Django directory
  • learnersourcing/learnersourcing: Django project
  • learnersourcing/subgoal: Django app
  • Django admin credentials: uid / subgoals

Deployment

We're using Apache + mod_wsgi for live deployment.

TODO: document the apache conf setup

Here are the steps for setting up the deployment folder structure:

  • git clone https://github.com/uid/learnersourcing-subgoal-labels.git
  • sudo chown -R juhokim:uid learnersourcing-subgoal-labels
  • chmod 775 learnersourcing-subgoal-labels/
  • sudo chown -R www-data:www-data learnersourcing-subgoal-labels/learnersourcing/db
  • sudo mkdir -p /var/www/learnersourcing/static
  • sudo chown -R juhokim:uid /var/www/learnersourcing
  • python manage.py collectstatic

For troubleshooting, https://code.djangoproject.com/wiki/NewbieMistakes

Migration

migration with south: in case you're not familiar...

  1. The developer (you) change the models.py file, updating the application's data model.
  2. Run manage.py schemamigration subgoal --auto to create a migration file for generation N+1.
  3. Run manage.py migrate subgoal to update the database schema and migrationhistory table to generation N+1.

Session management

In order to differentiate activities between each anonymous user, we store request.session.session_key for page session, action, and record. But Django by default does not have a valid session_key until the first view is fully rendered, which means that the view handling the initial request does not have the right session_key. To address this issue, we added custom middleware that manually saves a session before the view handles the request to secure a session_key.

Caveat: Even with this fix, the first time session has a different session ID from the rest of the user's session IDs. Should be careful when analyzing sessions to map with each user activity.

About

Learnersourcing workflow for how-to videos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published