From 7c594090e99d9213e55d2563c6c653008c876dce Mon Sep 17 00:00:00 2001 From: olivier <> Date: Wed, 23 May 2007 19:36:57 +0000 Subject: [PATCH] make htdocs variable dynamic and add draft for 0.3 INSTALL --- doc/INSTALL.0.3.draft | 65 +++++++++++++++++++++++++++++++++++++++++++ telemeta/urls.py | 3 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 doc/INSTALL.0.3.draft diff --git a/doc/INSTALL.0.3.draft b/doc/INSTALL.0.3.draft new file mode 100644 index 00000000..e5383e77 --- /dev/null +++ b/doc/INSTALL.0.3.draft @@ -0,0 +1,65 @@ +DRAFT FOR TELEMETA 0.3 INSTALLATION + +Requirements: +- Python >= 2.4 +- Mutagen >= 1.11 : http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen +- Tkinter (named python-tk in Debian) + +1 - Checkout Telemeta: + +cd ~/my_apps +svn co http://svn.yomix.org/svn/telemeta/trunk telemeta + +1bis: compile wav2png (need libgd et libsndfile) + +1 - Install the development version of the Django framework: + +Warning: last know revision that works with Telemeta: 5313 + +http://www.djangoproject.com + +2 - Create a Django project if you haven't already done it: + +$ cd ~/my_projects +$ django-admin startproject mysite + +3 - Put a link to telemeta into your Django project: + +$ ln -s ~/my_apps/telemeta/telemeta ~/my_projects/mysite/telemeta + +OR: add the telemeta path to PYTHONPATH + +4 - Create the media and cache directories: +$ cd mysite +$ mkdir media cache +(You might want to place these somewhere else) + +5 - Configure Django (settings.py): + +Modifiy the following variables: + + DATABASE_*: your database settings (don't forget to create the database if needed) + MEDIA_ROOT: absolute path to the media directory you just created + INSTALLED_APPS: add 'mysite.telemeta' + +Add the following variables: + + TELEMETA_CACHE_DIR: absolute path to the cache directory you just created + + Just paste the two lines below: + TELEMETA_EXPORT_CACHE_DIR = TELEMETA_CACHE_DIR + "/export" + CACHE_BACKEND = "file://" + TELEMETA_CACHE_DIR + "/data" + +6 - Initialize the database: + +$ python manage.py syncdb + +7 - Configure your urls: + +The simplest case is to have telemeta running at public root. To do so, add +this url in urls.py : + +(r'^', include('telemeta.urls')), + + + diff --git a/telemeta/urls.py b/telemeta/urls.py index 01cf5326..9e24a64d 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -11,6 +11,7 @@ from django.conf.urls.defaults import * from telemeta.models import MediaItem, MediaCollection from telemeta.core import ComponentManager from telemeta.web import WebView +import os.path # initialization comp_mgr = ComponentManager() @@ -24,7 +25,7 @@ all_collections = { 'queryset': MediaCollection.objects.all(), } i_ex = MediaItem.id_regex c_ex = MediaCollection.id_regex -htdocs='./telemeta/htdocs' +htdocs = os.path.dirname(__file__) + '/htdocs' urlpatterns = patterns('', url(r'^$', web_view.index, name="telemeta-home"), -- 2.39.5