| 1 | ================== |
|---|
| 2 | Telemeta - INSTALL |
|---|
| 3 | ================== |
|---|
| 4 | |
|---|
| 5 | ----------------- |
|---|
| 6 | 0. Requirements |
|---|
| 7 | ----------------- |
|---|
| 8 | |
|---|
| 9 | Telemeta is designed to run on Linux and other UNIX based architectures. |
|---|
| 10 | It depends on several python librairies like Django (version >= 1.1.1). |
|---|
| 11 | See http://djangoproject.com. |
|---|
| 12 | |
|---|
| 13 | Other needed librairies are listed below. |
|---|
| 14 | |
|---|
| 15 | ----------------------- |
|---|
| 16 | 1. Install the software |
|---|
| 17 | ----------------------- |
|---|
| 18 | |
|---|
| 19 | Install the dependencies |
|---|
| 20 | ------------------------- |
|---|
| 21 | |
|---|
| 22 | * On Debian (Squeeze recommended) or Ubuntu Lucid: |
|---|
| 23 | |
|---|
| 24 | Install all dependencies like this:: |
|---|
| 25 | |
|---|
| 26 | sudo aptitude install python python-django python-xml python-mysqldb mysql-server \ |
|---|
| 27 | python-ctypes python-setuptools python-support python-docutils \ |
|---|
| 28 | python-libxml2 python-django-registration |
|---|
| 29 | |
|---|
| 30 | To get MP3 reading and writing, just add these lines to your /etc/apt/sources-list:: |
|---|
| 31 | |
|---|
| 32 | deb http://www.debian-multimedia.org stable main |
|---|
| 33 | |
|---|
| 34 | Then:: |
|---|
| 35 | |
|---|
| 36 | sudo apt-get update |
|---|
| 37 | sudo aptitude install gstreamer0.10-fluendo-mp3 gstreamer0.10-lame |
|---|
| 38 | |
|---|
| 39 | * On other linux platforms: |
|---|
| 40 | |
|---|
| 41 | Please install all dependencies thanks to your application manager. |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | Install TimeSide |
|---|
| 45 | ----------------- |
|---|
| 46 | |
|---|
| 47 | Telemeta needs the audio processing library named TimeSide (>= 0.3) |
|---|
| 48 | You have to download and install it from source. |
|---|
| 49 | |
|---|
| 50 | So, download the last archive at : |
|---|
| 51 | http://code.google.com/p/timeside/downloads/list |
|---|
| 52 | |
|---|
| 53 | Uncompress it and see README and INSTALL to install the dependencies |
|---|
| 54 | and then the module. |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | Install JSON-RPC server |
|---|
| 58 | ------------------------ |
|---|
| 59 | |
|---|
| 60 | In order to use markers on the player, you will need a JSON-RPC server for django:: |
|---|
| 61 | |
|---|
| 62 | git clone git://github.com/samuraisam/django-json-rpc.git |
|---|
| 63 | cd django-json-rpc |
|---|
| 64 | python setup.py install |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | Install Telemeta |
|---|
| 68 | ------------------ |
|---|
| 69 | |
|---|
| 70 | * On Debian style systems, if you have added our repositories:: |
|---|
| 71 | |
|---|
| 72 | sudo apt-get install telemeta |
|---|
| 73 | |
|---|
| 74 | * Else: |
|---|
| 75 | |
|---|
| 76 | Download the latest release of telemeta at |
|---|
| 77 | http://telemeta.org |
|---|
| 78 | |
|---|
| 79 | Uncompress the archive like:: |
|---|
| 80 | |
|---|
| 81 | tar xzvf telemeta_0.5.1.tar.gz |
|---|
| 82 | |
|---|
| 83 | Go to the main folder of telemeta and run this command |
|---|
| 84 | in a shell as root:: |
|---|
| 85 | |
|---|
| 86 | sudo python setup.py install |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | -------------------------- |
|---|
| 90 | 2. Create a Django project |
|---|
| 91 | -------------------------- |
|---|
| 92 | |
|---|
| 93 | If you haven't already done it, start a new django project:: |
|---|
| 94 | |
|---|
| 95 | cd ~/my_projects |
|---|
| 96 | django-admin startproject mysite |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | ----------------------------------------- |
|---|
| 100 | 3. Create the media and cache directories |
|---|
| 101 | ----------------------------------------- |
|---|
| 102 | |
|---|
| 103 | We need 2 directories for media and caching:: |
|---|
| 104 | |
|---|
| 105 | cd mysite |
|---|
| 106 | mkdir media cache cache/data cache/export |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | You might want to place these data directories somewhere else, no pb. |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | ---------------------------------- |
|---|
| 113 | 4. Configure the telemeta project |
|---|
| 114 | ---------------------------------- |
|---|
| 115 | |
|---|
| 116 | Edit the file settings.py in a text editor. |
|---|
| 117 | Modifiy the following variables: |
|---|
| 118 | |
|---|
| 119 | ADMINS = telemeta requires that you indicate an administrator here |
|---|
| 120 | DATABASES = your database setting dict (don't forget to create the database if needed) |
|---|
| 121 | MEDIA_ROOT = absolute path to the media directory you just created |
|---|
| 122 | INSTALLED_APPS = add 'telemeta' and 'jsonrpc' to the tuple |
|---|
| 123 | |
|---|
| 124 | Set the following languages: |
|---|
| 125 | |
|---|
| 126 | LANGUAGES = [ ('fr', 'French'), |
|---|
| 127 | ('en', 'English'), |
|---|
| 128 | ] |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | Set the following Middlewares: |
|---|
| 132 | |
|---|
| 133 | MIDDLEWARE_CLASSES = ( |
|---|
| 134 | 'django.middleware.common.CommonMiddleware', |
|---|
| 135 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|---|
| 136 | 'django.middleware.csrf.CsrfViewMiddleware', |
|---|
| 137 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|---|
| 138 | 'django.contrib.messages.middleware.MessageMiddleware', |
|---|
| 139 | 'django.middleware.locale.LocaleMiddleware', |
|---|
| 140 | ) |
|---|
| 141 | |
|---|
| 142 | Add the following variables: |
|---|
| 143 | |
|---|
| 144 | TEMPLATE_CONTEXT_PROCESSORS = ( |
|---|
| 145 | 'django.core.context_processors.request', |
|---|
| 146 | 'django.contrib.auth.context_processors.auth',) |
|---|
| 147 | |
|---|
| 148 | TELEMETA_ORGANIZATION = name of the organization which hosts this installation |
|---|
| 149 | TELEMETA_SUBJECTS = tuple of subject keywords (used for Dublin Core), such as "Ethnology", etc... |
|---|
| 150 | TELEMETA_CACHE_DIR = absolute path to the cache directory that you just created |
|---|
| 151 | TELEMETA_GMAP_KEY = your Google Map API key |
|---|
| 152 | TELEMETA_DOWNLOAD_ENABLED = True to enable raw audio data download |
|---|
| 153 | TELEMETA_STREAMING_FORMATS = tuple of authoized streaming formats. Ex : ('mp3', 'ogg') |
|---|
| 154 | TELEMETA_PUBLIC_ACCESS_PERIOD = number of years above which item files are automagically published |
|---|
| 155 | EMAIL_HOST = your default SMTP server |
|---|
| 156 | DEFAULT_FROM_EMAIL = the default sending email address |
|---|
| 157 | |
|---|
| 158 | Just paste the lines below:: |
|---|
| 159 | |
|---|
| 160 | LOGIN_URL = '/login' |
|---|
| 161 | LOGIN_REDIRECT_URL = '/' |
|---|
| 162 | AUTH_PROFILE_MODULE = 'telemeta.userprofile' |
|---|
| 163 | TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" |
|---|
| 164 | TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data" |
|---|
| 165 | CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data" |
|---|
| 166 | |
|---|
| 167 | You can find an example for settings.py there:: |
|---|
| 168 | |
|---|
| 169 | conf/examples/django/settings.py |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | -------------------------- |
|---|
| 173 | 5. Initialize the database |
|---|
| 174 | -------------------------- |
|---|
| 175 | |
|---|
| 176 | This synchronizes the DB with the model:: |
|---|
| 177 | |
|---|
| 178 | python manage.py syncdb |
|---|
| 179 | |
|---|
| 180 | |
|---|
| 181 | ---------------------- |
|---|
| 182 | 6. Configure your urls |
|---|
| 183 | ---------------------- |
|---|
| 184 | |
|---|
| 185 | Add this dictionary to get Javascript translation:: |
|---|
| 186 | |
|---|
| 187 | js_info_dict = { |
|---|
| 188 | 'packages': ('telemeta',), |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | The simplest case is to have telemeta running at public root. To do so, add this url in urls.py:: |
|---|
| 192 | |
|---|
| 193 | # Telemeta |
|---|
| 194 | (r'^', include('telemeta.urls')), |
|---|
| 195 | |
|---|
| 196 | # Languages |
|---|
| 197 | (r'^i18n/', include('django.conf.urls.i18n')), |
|---|
| 198 | (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), |
|---|
| 199 | |
|---|
| 200 | You can find an example for url.py there:: |
|---|
| 201 | |
|---|
| 202 | conf/examples/django/urls.py |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | -------------------- |
|---|
| 206 | 7. Start the project |
|---|
| 207 | -------------------- |
|---|
| 208 | |
|---|
| 209 | We are ready to start the telemeta server:: |
|---|
| 210 | |
|---|
| 211 | python manage.py runserver |
|---|
| 212 | |
|---|
| 213 | By default, the server starts on the port 8000. You can override this with, for example:: |
|---|
| 214 | |
|---|
| 215 | python manage.py runserver 9000 |
|---|
| 216 | |
|---|
| 217 | |
|---|
| 218 | ----------- |
|---|
| 219 | 8. Test it |
|---|
| 220 | ----------- |
|---|
| 221 | |
|---|
| 222 | Go to this URL with your browser:: |
|---|
| 223 | |
|---|
| 224 | http://localhost:8000 |
|---|
| 225 | |
|---|
| 226 | or:: |
|---|
| 227 | |
|---|
| 228 | http://localhost:9000 |
|---|
| 229 | |
|---|
| 230 | Test it and enjoy it ! |
|---|
| 231 | |
|---|
| 232 | |
|---|
| 233 | -------------------------- |
|---|
| 234 | 9. Deploy it with Apache |
|---|
| 235 | -------------------------- |
|---|
| 236 | |
|---|
| 237 | If you want to use Telemeta through a web server, it is highly recommended to use Apache 2 |
|---|
| 238 | with the mod_wsgi module as explained in the following page : |
|---|
| 239 | |
|---|
| 240 | http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/#howto-deployment-modwsgi |
|---|
| 241 | |
|---|
| 242 | This will prevent Apache to put some audio data in the cache memory as it is usually the case with mod_python. |
|---|
| 243 | |
|---|
| 244 | You can find an example of an Apache2 VirtualHost conf file there:: |
|---|
| 245 | |
|---|
| 246 | conf/examples/apache2/telemeta.conf |
|---|
| 247 | |
|---|
| 248 | |
|---|
| 249 | ------------------------- |
|---|
| 250 | 10. Contact / More infos |
|---|
| 251 | ------------------------- |
|---|
| 252 | |
|---|
| 253 | See README and http://telemeta.org. |
|---|
| 254 | |
|---|