source: INSTALL.rst

dj1.6
Last change on this file was afd181b, checked in by Guillaume Pellerin <yomguy@…>, 4 weeks ago

modify install tips, add chinese translations

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