| 1 | =========== |
|---|
| 2 | INSTALL |
|---|
| 3 | =========== |
|---|
| 4 | |
|---|
| 5 | Don't worry, Telemeta is easy to setup as any other Django app ! |
|---|
| 6 | |
|---|
| 7 | ----------------- |
|---|
| 8 | Requirements |
|---|
| 9 | ----------------- |
|---|
| 10 | |
|---|
| 11 | Telemeta is designed to run on Linux and other UNIX based architectures. |
|---|
| 12 | It depends on several python librairies like Django (version >= 1.3.1). |
|---|
| 13 | See http://djangoproject.com. |
|---|
| 14 | |
|---|
| 15 | Other needed librairies are listed below. |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | Install 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 |
|---|
| 30 | |
|---|
| 31 | To get MP3 reading and writing, just add these lines to your /etc/apt/sources-list:: |
|---|
| 32 | |
|---|
| 33 | deb http://www.debian-multimedia.org stable main |
|---|
| 34 | |
|---|
| 35 | Then:: |
|---|
| 36 | |
|---|
| 37 | sudo apt-get update |
|---|
| 38 | sudo aptitude install gstreamer0.10-fluendo-mp3 gstreamer0.10-lame |
|---|
| 39 | |
|---|
| 40 | * On other linux platforms: |
|---|
| 41 | |
|---|
| 42 | Please install all dependencies thanks to your application manager. |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | Install Telemeta |
|---|
| 46 | ------------------ |
|---|
| 47 | |
|---|
| 48 | * The best is to use the python package tools (install MANY dependencies automatically):: |
|---|
| 49 | |
|---|
| 50 | sudo aptitude install python-pip |
|---|
| 51 | sudo pip install telemeta |
|---|
| 52 | |
|---|
| 53 | or (deprecated):: |
|---|
| 54 | |
|---|
| 55 | sudo easy_install telemeta |
|---|
| 56 | |
|---|
| 57 | * Downloading the latest tar archive at http://telemeta.org. Uncompress it and install. For example:: |
|---|
| 58 | |
|---|
| 59 | tar xzf telemeta-1.0.tar.gz |
|---|
| 60 | cd telemeta-1.0 |
|---|
| 61 | sudo python setup.py install |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | Install TimeSide |
|---|
| 65 | ----------------- |
|---|
| 66 | |
|---|
| 67 | The web audio components provided by the TimeSide module have been automatically installed if you used pip or setup.py to install Telemeta. In this case only, you can pass this stage. |
|---|
| 68 | |
|---|
| 69 | Otherwise, you have to download and install it from source. |
|---|
| 70 | |
|---|
| 71 | So, download the last archive at : |
|---|
| 72 | http://code.google.com/p/timeside/downloads/list |
|---|
| 73 | |
|---|
| 74 | Uncompress it and read README and INSTALL to install the dependencies |
|---|
| 75 | and then the module. |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | Install JSON-RPC server |
|---|
| 79 | ------------------------ |
|---|
| 80 | |
|---|
| 81 | The JSON module provided by django-json-rpc have been automatically installed if you used pip or setup.py to install Telemeta. In this case only, you can pass this stage. |
|---|
| 82 | |
|---|
| 83 | Otherwise, you have to download and install it from source:: |
|---|
| 84 | |
|---|
| 85 | git clone git://github.com/samuraisam/django-json-rpc.git |
|---|
| 86 | cd django-json-rpc |
|---|
| 87 | python setup.py install |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | ------------------------- |
|---|
| 91 | Testing (sandbox) |
|---|
| 92 | ------------------------- |
|---|
| 93 | |
|---|
| 94 | If you just want to test Telemeta, a sandbox is available in the example/ directory. |
|---|
| 95 | As Telemeta needs MySQL to work properly and fast, please create a database before editing setting.py |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | -------------------------- |
|---|
| 99 | Create a Django project |
|---|
| 100 | -------------------------- |
|---|
| 101 | |
|---|
| 102 | Start the project |
|---|
| 103 | ------------------ |
|---|
| 104 | |
|---|
| 105 | If you haven't already done it, start a new django project:: |
|---|
| 106 | |
|---|
| 107 | cd ~/my_projects |
|---|
| 108 | django-admin startproject mysite |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | Create the database |
|---|
| 112 | ------------------------ |
|---|
| 113 | |
|---|
| 114 | Telemeta needs MySQL to work well and fast. So you need to create a MySQL database before trying it. |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | Configure the telemeta project |
|---|
| 118 | ---------------------------------- |
|---|
| 119 | |
|---|
| 120 | Edit the file settings.py in a text editor. |
|---|
| 121 | Modifiy the following variables:: |
|---|
| 122 | |
|---|
| 123 | ADMINS = telemeta requires that you indicate an administrator here |
|---|
| 124 | DATABASES = your database setting dict (don't forget to create the database if needed) |
|---|
| 125 | MEDIA_ROOT = absolute path to the media directory you just created |
|---|
| 126 | |
|---|
| 127 | Set the app lists as follow:: |
|---|
| 128 | |
|---|
| 129 | INSTALLED_APPS = ( |
|---|
| 130 | 'django.contrib.auth', |
|---|
| 131 | 'django.contrib.contenttypes', |
|---|
| 132 | 'django.contrib.sessions', |
|---|
| 133 | 'django.contrib.sites', |
|---|
| 134 | 'django.contrib.messages', |
|---|
| 135 | 'django.contrib.admin', |
|---|
| 136 | 'telemeta', |
|---|
| 137 | 'jsonrpc', |
|---|
| 138 | ) |
|---|
| 139 | |
|---|
| 140 | Set the following languages:: |
|---|
| 141 | |
|---|
| 142 | LANGUAGES = [ ('fr', 'French'), |
|---|
| 143 | ('en', 'English'), |
|---|
| 144 | ] |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | Set the following Middlewares:: |
|---|
| 148 | |
|---|
| 149 | MIDDLEWARE_CLASSES = ( |
|---|
| 150 | 'django.middleware.common.CommonMiddleware', |
|---|
| 151 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|---|
| 152 | 'django.middleware.csrf.CsrfViewMiddleware', |
|---|
| 153 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|---|
| 154 | 'django.contrib.messages.middleware.MessageMiddleware', |
|---|
| 155 | 'django.middleware.locale.LocaleMiddleware', |
|---|
| 156 | ) |
|---|
| 157 | |
|---|
| 158 | Add the following variables:: |
|---|
| 159 | |
|---|
| 160 | TEMPLATE_CONTEXT_PROCESSORS = ( |
|---|
| 161 | 'django.core.context_processors.request', |
|---|
| 162 | 'django.contrib.auth.context_processors.auth',) |
|---|
| 163 | |
|---|
| 164 | TELEMETA_ORGANIZATION = name of the organization which hosts this installation |
|---|
| 165 | TELEMETA_SUBJECTS = tuple of subject keywords (used for Dublin Core), such as "Ethnology", etc... |
|---|
| 166 | TELEMETA_DESCRIPTION = the description of the site |
|---|
| 167 | TELEMETA_CACHE_DIR = absolute path to the cache directory that you just created |
|---|
| 168 | TELEMETA_GMAP_KEY = your Google Map API key |
|---|
| 169 | TELEMETA_DOWNLOAD_ENABLED = True to enable raw audio data download |
|---|
| 170 | TELEMETA_STREAMING_FORMATS = tuple of authoized streaming formats. Ex : ('mp3', 'ogg') |
|---|
| 171 | TELEMETA_PUBLIC_ACCESS_PERIOD = number of years above which item files are automagically published |
|---|
| 172 | EMAIL_HOST = your default SMTP server |
|---|
| 173 | DEFAULT_FROM_EMAIL = the default sending email address |
|---|
| 174 | |
|---|
| 175 | Just paste the lines below:: |
|---|
| 176 | |
|---|
| 177 | LOGIN_URL = '/login' |
|---|
| 178 | LOGIN_REDIRECT_URL = '/' |
|---|
| 179 | AUTH_PROFILE_MODULE = 'telemeta.userprofile' |
|---|
| 180 | TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" |
|---|
| 181 | TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "/data" |
|---|
| 182 | CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data" |
|---|
| 183 | |
|---|
| 184 | If you want some personal templates, for example:: |
|---|
| 185 | |
|---|
| 186 | TEMPLATE_DIRS = ( |
|---|
| 187 | '/home/dev/telemeta/sandboxes/sandbox_generic/templates/', |
|---|
| 188 | ) |
|---|
| 189 | |
|---|
| 190 | You can find an example for settings.py there:: |
|---|
| 191 | |
|---|
| 192 | example/sandbox/settings.py |
|---|
| 193 | |
|---|
| 194 | |
|---|
| 195 | Initialize the database |
|---|
| 196 | -------------------------- |
|---|
| 197 | |
|---|
| 198 | This synchronizes the DB with the model:: |
|---|
| 199 | |
|---|
| 200 | python manage.py syncdb |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | Configure your urls |
|---|
| 204 | ---------------------- |
|---|
| 205 | |
|---|
| 206 | Add this dictionary to get Javascript translation:: |
|---|
| 207 | |
|---|
| 208 | js_info_dict = { |
|---|
| 209 | 'packages': ('telemeta',), |
|---|
| 210 | } |
|---|
| 211 | |
|---|
| 212 | The simplest case is to have telemeta running at public root. To do so, add this url in urls.py:: |
|---|
| 213 | |
|---|
| 214 | # Telemeta |
|---|
| 215 | (r'^', include('telemeta.urls')), |
|---|
| 216 | |
|---|
| 217 | # Languages |
|---|
| 218 | (r'^i18n/', include('django.conf.urls.i18n')), |
|---|
| 219 | (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict), |
|---|
| 220 | |
|---|
| 221 | You should also bring the django admin:: |
|---|
| 222 | |
|---|
| 223 | (r'^admin/django/', include(admin.site.urls)), |
|---|
| 224 | |
|---|
| 225 | Please also uncomment:: |
|---|
| 226 | |
|---|
| 227 | from django.contrib import admin |
|---|
| 228 | admin.autodiscover() |
|---|
| 229 | |
|---|
| 230 | You can find an example for url.py there:: |
|---|
| 231 | |
|---|
| 232 | example/sandbox/urls.py |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | Start the project |
|---|
| 236 | -------------------- |
|---|
| 237 | |
|---|
| 238 | We are ready to start the telemeta server:: |
|---|
| 239 | |
|---|
| 240 | python manage.py runserver |
|---|
| 241 | |
|---|
| 242 | By default, the server starts on the port 8000. You can override this with, for example:: |
|---|
| 243 | |
|---|
| 244 | python manage.py runserver 9000 |
|---|
| 245 | |
|---|
| 246 | To get it on your network interface:: |
|---|
| 247 | |
|---|
| 248 | python manage.py runserver 192.168.0.10:9000 |
|---|
| 249 | |
|---|
| 250 | |
|---|
| 251 | Test it |
|---|
| 252 | ----------- |
|---|
| 253 | |
|---|
| 254 | Go to this URL with your browser:: |
|---|
| 255 | |
|---|
| 256 | http://localhost:8000 |
|---|
| 257 | |
|---|
| 258 | or:: |
|---|
| 259 | |
|---|
| 260 | http://localhost:9000 |
|---|
| 261 | |
|---|
| 262 | or:: |
|---|
| 263 | |
|---|
| 264 | http://192.168.0.10:9000 |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | Configure the site domain name in admin > general admin > sites |
|---|
| 268 | |
|---|
| 269 | Test it and enjoy it ! |
|---|
| 270 | |
|---|
| 271 | |
|---|
| 272 | -------------------------- |
|---|
| 273 | Template customization |
|---|
| 274 | -------------------------- |
|---|
| 275 | |
|---|
| 276 | Please see :: |
|---|
| 277 | |
|---|
| 278 | http://telemeta.org/wiki/InterfaceCustomization |
|---|
| 279 | |
|---|
| 280 | |
|---|
| 281 | -------------------------- |
|---|
| 282 | Deploy it with Apache 2 |
|---|
| 283 | -------------------------- |
|---|
| 284 | |
|---|
| 285 | If you want to use Telemeta through a web server, it is highly recommended to use Apache 2 |
|---|
| 286 | with the mod_wsgi module as explained in the following page :: |
|---|
| 287 | |
|---|
| 288 | http://docs.djangoproject.com/en/1.1/howto/deployment/modwsgi/#howto-deployment-modwsgi |
|---|
| 289 | |
|---|
| 290 | This will prevent Apache to put some audio data in the cache memory as it is usually the case with mod_python. |
|---|
| 291 | |
|---|
| 292 | You can find an example of an Apache2 VirtualHost conf file there:: |
|---|
| 293 | |
|---|
| 294 | example/apache2/telemeta.conf |
|---|
| 295 | |
|---|
| 296 | |
|---|
| 297 | ------------------------- |
|---|
| 298 | IP based authorization |
|---|
| 299 | ------------------------- |
|---|
| 300 | |
|---|
| 301 | It is possible to login automatically an IP range of machines to Telemeta thanks to the django-ipauth module:: |
|---|
| 302 | |
|---|
| 303 | sudo pip install django-ipauth |
|---|
| 304 | |
|---|
| 305 | See http://pypi.python.org/pypi/django-ipauth/ for setup. |
|---|
| 306 | |
|---|
| 307 | |
|---|
| 308 | ------------------------- |
|---|
| 309 | Contact / More infos |
|---|
| 310 | ------------------------- |
|---|
| 311 | |
|---|
| 312 | See README.rst and http://telemeta.org. |
|---|
| 313 | |
|---|