source: INSTALL.rst

dev
Last change on this file was f31282e, checked in by Guillaume Pellerin <yomguy@…>, 5 weeks ago

update install info

  • Property mode set to 100644
File size: 9.4 KB
Line 
1-----------------
2Requirements
3-----------------
4
5Don't worry, Telemeta is easy to setup as any other Django app but requires some extra apps and modules to run. It is designed to run on Linux and other UNIX based architectures.
6
7Install the system dependencies
8--------------------------------
9
10* On Debian (Squeeze recommended) or Ubuntu Lucid:
11
12    Install all dependencies like this::
13
14        sudo aptitude install gcc python python-dev python-django python-xml \
15            python-ctypes python-setuptools python-support python-docutils \
16            python-libxml2 python-django-registration python-lxml python-numpy \
17            python-scipy python-imaging python-mutagen python-gobject python-gst0.10 \
18            gstreamer0.10-plugins-base gobject-introspection python-django-south
19            python-pip gir1.2-gstreamer-0.10 gstreamer0.10-plugins-good gstreamer0.10-plugins-bad
20
21    To get non-free (MP3, MP4, AAC, etc) decoding and encoding features, add Debian Multimedia repository and install the modules::
22
23        echo "deb http://www.deb-multimedia.org stable main non-free" | sudo tee -a /etc/apt/sources.list
24        sudo apt-get update
25        sudo apt-get install gstreamer0.10-lame gstreamer0.10-plugins-really-bad gstreamer0.10-plugins-ugly
26
27* On other linux platforms:
28
29    Please install all the equivalent dependencies thanks to your application manager or manually.
30
31
32Install Telemeta
33-----------------------------
34
35Pip method (highly recommended!)
36+++++++++++++++++++++++++++++++++
37
38We strongly advise you use the python package tool as it installs some good dependencies automatically::
39
40    sudo pip install telemeta
41
42or (deprecated)::
43
44    sudo easy_install telemeta
45
46From sources
47+++++++++++++
48
49Download the latest tar archive at http://telemeta.org.
50
51Uncompress and install it like this::
52
53    tar xzf telemeta-1.0.tar.gz
54    cd telemeta-1.0
55    sudo python setup.py install
56
57For development
58++++++++++++++++
59
60Download the latest tar archive at http://telemeta.org and::
61
62    tar xzf telemeta-1.0.tar.gz
63    cd telemeta-1.0
64    sudo pip install -e .
65    export PYTHONPATH=$PYTHONPATH:`pwd`
66
67-------------------------
68Fast testing (sandbox)
69-------------------------
70
71If you just want to test Telemeta just now, a sandbox is available in the example/ directory::
72
73    cd example/sandbox
74    ./manage.py syncdb
75    ./manage.py migrate
76    ./manage.py runserver 9000
77
78Now browse http://localhost:9000
79
80-------------------------------
81Create a new Telemeta project
82-------------------------------
83
84Start your project
85------------------
86
87For example::
88
89    cd ~/my_projects
90    django-admin startproject mysite
91
92Create the database
93------------------------
94
95Telemeta needs MySQL to work well and fast. So you need to create a MySQL database before trying it.
96But you can also use SQLite, PostgreSQL or Oracle DB.
97
98Configure the telemeta project
99----------------------------------
100
101Edit the file settings.py in a text editor. You can find (even copy) an example there::
102
103    example/sandbox/settings.py
104
105Modifiy the following variables::
106
107    ADMINS =            telemeta requires that you indicate an administrator here
108    DATABASES =         your database setting dict (don't forget to create the database if needed)
109    MEDIA_ROOT =        absolute path to the media directory you just created
110
111Set the app lists as follow::
112
113    INSTALLED_APPS = (
114    'django.contrib.auth',
115    'django.contrib.contenttypes',
116    'django.contrib.sessions',
117    'django.contrib.sites',
118    'django.contrib.messages',
119    'django.contrib.admin',
120    'telemeta',
121    'timeside',
122    'jsonrpc',
123    'south',
124    'sorl.thumbnail',
125    'timezones',
126    'jqchat',
127    )
128
129Set the following languages::
130
131    LANGUAGES = [ ('fr', 'French'),
132                  ('en', 'English'),
133    ]
134
135Set the following Middlewares::
136
137    MIDDLEWARE_CLASSES = (
138        'django.middleware.common.CommonMiddleware',
139        'django.contrib.sessions.middleware.SessionMiddleware',
140        'django.middleware.csrf.CsrfViewMiddleware',
141        'django.contrib.auth.middleware.AuthenticationMiddleware',
142        'django.contrib.messages.middleware.MessageMiddleware',
143        'django.middleware.locale.LocaleMiddleware',
144    )
145
146and the following processors::
147
148    TEMPLATE_CONTEXT_PROCESSORS = (
149        'django.core.context_processors.request',
150        'django.contrib.auth.context_processors.auth',
151        'django.core.context_processors.i18n',
152        'django.core.context_processors.media',
153        'django.core.context_processors.static',)
154
155Add the following variables::
156
157    TELEMETA_ORGANIZATION =         name of the organization which hosts this installation
158    TELEMETA_SUBJECTS =             tuple of subject keywords (used for Dublin Core), such as "Ethnology", etc...
159    TELEMETA_DESCRIPTION =          the description of the site
160    TELEMETA_CACHE_DIR =            absolute path to the cache directory that you just created
161    TELEMETA_GMAP_KEY =             your Google Map API key
162    TELEMETA_DOWNLOAD_ENABLED =     True to enable raw audio data download
163    TELEMETA_STREAMING_FORMATS =    tuple of authorized streaming formats. Ex: ('mp3', 'ogg')
164    TELEMETA_DOWNLOAD_FORMATS =     tuple of authorized download formats. Ex: ('wav', 'mp3', 'webm')
165    TELEMETA_PUBLIC_ACCESS_PERIOD = number of years above which item files are automagically published
166    EMAIL_HOST =                    your default SMTP server
167    DEFAULT_FROM_EMAIL =            the default sending email address
168
169Just paste the lines below::
170
171    LOGIN_URL = '/login'
172    LOGIN_REDIRECT_URL = '/'
173    AUTH_PROFILE_MODULE = 'telemeta.userprofile'
174    TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export"
175    TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data"
176    CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data"
177
178Optional: if you want some personal templates, for example::
179
180    TEMPLATE_DIRS = (
181    '/home/dev/telemeta/sandboxes/sandbox_generic/templates/',
182    )
183
184
185Configure your urls
186----------------------
187
188You can find (even copy) an example of url.py there::
189
190    example/sandbox/urls.py
191
192Add this dictionary to get Javascript translation::
193
194    js_info_dict = {
195        'packages': ('telemeta',),
196    }
197
198The simplest case is to have telemeta running at public root. To do so, add this url in urls.py::
199
200    # Telemeta
201    (r'^', include('telemeta.urls')),
202
203    # Languages
204    (r'^i18n/', include('django.conf.urls.i18n')),
205    (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
206
207You should also bring the django admin::
208
209    (r'^admin/django/', include(admin.site.urls)),
210
211Please also uncomment::
212
213    from django.contrib import admin
214    admin.autodiscover()
215
216
217Initialize the database
218--------------------------
219
220This synchronizes the DB with the model::
221
222    ./manage.py syncdb
223
224If you want tu use the data schema migration system (South needed, see previous paragraph)::
225
226    ./manage.py migrate telemeta
227
228Then::
229
230    ./manage.py collectstatic
231
232
233Start the project
234--------------------
235
236We are ready to start the telemeta server::
237
238    python manage.py runserver
239
240By default, the server starts on the port 8000. You can override this with, for example::
241
242    python manage.py runserver 9000
243
244To get it on your network interface::
245
246    python manage.py runserver 192.168.0.10:9000
247
248
249Test it
250-----------
251
252Go to this URL with your browser::
253
254    http://localhost:8000
255
256or::
257
258    http://localhost:9000
259
260or::
261
262    http://192.168.0.10:9000
263
264
265Configure the site domain name in admin > general admin > sites
266
267Test it and enjoy it !
268
269
270--------------------------
271Template customization
272--------------------------
273
274Please see ::
275
276    http://telemeta.org/wiki/InterfaceCustomization
277
278
279--------------------------
280Deploy it with Apache 2
281--------------------------
282
283If you want to use Telemeta through a web server, it is highly recommended to use Apache 2
284with the mod_wsgi module as explained in the following page ::
285
286    http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/#howto-deployment-modwsgi
287
288This will prevent Apache to put some audio data in the cache memory as it is usually the case with mod_python.
289
290You can find an example of an Apache2 VirtualHost conf file there::
291
292    example/apache2/telemeta.conf
293
294
295-------------------------
296IP based authorization
297-------------------------
298
299It is possible to login automatically an IP range of machines to Telemeta thanks to the django-ipauth module::
300
301    sudo pip install django-ipauth
302
303See http://pypi.python.org/pypi/django-ipauth/ for setup.
304
305
306----------------------------
307Import ISO 639-3 languages
308----------------------------
309
310From Telemeta 1.4, an ISO 639-3 language model has been implemented.
311
312The ISO language table content can be initialized with the official code set.
313Here is a import example where telemeta_crem5 is the SQL database::
314
315    wget http://www.sil.org/iso639-3/iso-639-3_20110525.tab
316    mysql -u root -p
317    load data infile 'iso-639-3_20110525.tab' into table telemeta_crem5.languages CHARACTER SET UTF8 ignore 1 lines (identifier, part2B, part2T, part1, scope, type, name, comment);
318
319If you upgraded Telemeta from a version previous or equal to 1.3, please update the media_items table as follow::
320
321    mysql -u root -p
322    use telemeta_crem5
323    ALTER TABLE media_items ADD COLUMN 'language_iso_id' integer;
324    ALTER TABLE 'media_items' ADD CONSTRAINT 'language_iso_id_refs_id_80b221' FOREIGN KEY ('language_iso_id') REFERENCES 'languages' ('id');
325
326-------------------------
327Contact / More infos
328-------------------------
329
330See README.rst and http://telemeta.org.
Note: See TracBrowser for help on using the repository browser.