source: INSTALL.rst

Last change on this file was 8aa0f032, checked in by Guillaume Pellerin <yomguy@…>, 3 weeks ago

update docs

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