forked from ccnmtl/mediathread
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
157 lines (112 loc) · 5.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
===========================================================
Mediathread
===========================================================
Mediathread is a Django site for multimedia annotations facilitating
collaboration on video and image analysis. Developed at the Columbia
Center for New Media Teaching and Learning (CCNMTL)
CODE: http://github.com/ccnmtl/mediathread (see wiki for some dev documentation)
INFO: http://ccnmtl.columbia.edu/mediathread
FORUM: http://groups.google.com/group/mediathread
REQUIREMENTS
------------
Python 2.6 (or 2.5)
Postgres (or MySQL)
In Ubuntu (for postgres 8.4, but just change version numbers):
$ sudo aptitude install postgres-8.4 postgresql-client-8.4 postgresql-server-dev-8.4 python-psycopg2 gcc python2.6 python-dev libc6-dev
INSTALLATION
------------
1. Mediathread relies on several submodules. The easiest way to download
it all is to run with git 1.6.5+ is:
git clone --recursive https://github.com/ccnmtl/mediathread.git
2. Build the database
For Postgres:
A. Create the database ($ createdb mediathread)
For MySQL:
A. Edit the file requirements/libs.txt
- comment out the line 'psycopg2'
- uncomment 'MySQLdb'
B. Create the database ($ echo "CREATE DATABASE mediathread" | mysql -uroot -p mysql)
For Both:
Edit the lines in settings_shared.py that start with DATABASE_ as appropriate
Even better would be:
$ mkdir deploy_specific
$ touch deploy_specific/__init__.py
# edit a file called deploy_specific/settings.py setting those same variables
which will override the values in settings_shared.py
This is where we add custom settings for our deployment that will not
be included in the open-sourced distribution
3. Bootstrap uses virtualenv to build a contained library in ve/
./bootstrap.py
NOTE: if you're using python2.5 use ./bootstrap-python25.py instead
# GT comment 1
# It has been a little while since I installed mediathread, but according to my notes I had also to install
# the wsgiref package, which did not seem to be included -- so I did the following
[root@mediathread wsgiref-0.1.2]# pwd
/root
[root@mediathread ~]# wget http://pypi.python.org/packages/source/w/wsgiref/wsgiref-0.1.2.zip#md5=29b146e6ebd0f9fb119fe321f7bcf6cb
[root@mediathread ~]# unzip wsgiref-0.1.2.zip
[root@mediathread ~]# cd wsgiref-0.1.2
[root@mediathread wsgiref-0.1.2]# python setup.py install
# GT comment 2
According to my notes, I had to uncomment a line from settings_shared.py -- my notes say: uncommented 'sites' application from settings_shared.py, since I know it causes database errors if it's missing when the db is built
[root@mediathread mediathread]# pwd
/var/www/mediathread/mediathread
[root@mediathread mediathread]# vi settings_shared.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
#'django.contrib.sites',
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
# GT comment 3
We're using mysql and saw an error related to this when running bootstrap.py:
Failed to install index for threadedcomments.ThreadedComment model: (1170, "BLOB/TEXT column 'tree_path' used in key specification without a key length")
More discussion here:
https://code.djangoproject.com/ticket/2495
http://drupal.org/node/146296
But it appears that syncdb adjusted things so that the index on tree_path uses a limit of 255:
mysql> show create table threadedcomments_comment;
( `comment_ptr_id` int(11) NOT NULL,
`title` longtext NOT NULL,
`parent_id` int(11) DEFAULT NULL,
`last_child_id` int(11) DEFAULT NULL,
`tree_path` longtext NOT NULL,
PRIMARY KEY (`comment_ptr_id`),
KEY `threadedcomments_comment_tree_path` (`tree_path`(255)),
KEY `threadedcomments_comment_63f17a16` (`parent_id`),
KEY `threadedcomments_comment_ffd563a7` (`last_child_id`)
)
=====
The rest of the instructions work like standard Django. See:
http://docs.djangoproject.com/en/1.1/
for more details.
=====
4. Sync the database
./manage.py syncdb
#create a superuser
5. Run locally (during development)
./manage.py runserver myhost.example.com:8000
6. For deployment to Apache, see our sample configuration in apache/prod.conf
This directory also contains standard django.wsgi file which can be used
with other webservers
====
Go to your site in a web browser.
====
7. The default database is not very useful. Login with the superuser you
created in Step #4.
8. Click the 'Create a Course' link.
- Click the "+" to make a group. Name it something like "test_course"
- Click the "+" to make a faculty group. Name it something like "test_course_faculty"
- In the "Add users to group" field...
= add yourself as a faculty member by putting your username with a "*" in front
like this "*admin"
= add some fellow faculty/student accounts -- you can create new accounts right here
(read the instructions under the textarea)
= Click "Save" and then click the upper-right link "Django administration" to get back to the regular site (yeah, not the most intuitive).
9. Experiment with saving assets by visiting:
http://myhost.example.com:8000/save/
10. For deployment, take a look at the apache/ directory for sample apache configuration files