source: INSTALL.rst @ da0b26b

cremcrem2devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiproductionrelease/1.4.4sabiodsecurityserversocialstoragetelecastertest
Last change on this file since da0b26b was da0b26b, checked in by yomguy <yomguy@…>, 3 years ago

fix doc

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