source: INSTALL.rst

diadems
Last change on this file was 36ef5af, checked in by yomguy <yomguy@…>, 9 months ago

fix doc

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