# HG changeset patch # User cavaliet # Date 1305217117 -7200 # Node ID 2affc8a44dfb45518446ee9646f48827a4eb7ead # Parent 6094ab306d77c8fe9a6006df284a73bfd2f4f865 Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls. diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Wed May 11 17:47:25 2011 +0200 +++ b/src/ldt/ldt/ldt_utils/models.py Thu May 12 18:18:37 2011 +0200 @@ -172,13 +172,13 @@ if 'http' in self.iriurl or 'https' in self.iriurl: return self.iriurl else: - return unicode(web_url) + unicode(settings.MEDIA_URL) + u"media/ldt/" + unicode(self.iriurl) + return unicode(web_url) + unicode(settings.MEDIA_URL) + u"ldt/" + unicode(self.iriurl) def iri_file_path(self): return os.path.join(os.path.join(os.path.join(os.path.join(settings.MEDIA_ROOT, "media"), "ldt"), self.iri_id), os.path.basename(self.iriurl)) def iri_url_template(self): - return "${web_url}${media_url}media/ldt/" + unicode(self.iri_id) + "/" + os.path.basename(self.iriurl) + return "${web_url}${media_url}ldt/" + unicode(self.iri_id) + "/" + os.path.basename(self.iriurl) def __get_empty_media(self): diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/settings.py --- a/src/ldt/ldt/settings.py Wed May 11 17:47:25 2011 +0200 +++ b/src/ldt/ldt/settings.py Thu May 12 18:18:37 2011 +0200 @@ -47,6 +47,7 @@ WEB_URL = getattr(settings, 'WEB_URL', '') BASE_URL = getattr(settings, 'BASE_URL', '') +STATIC_URL = getattr(settings, 'STATIC_URL', '') MEDIA_URL = getattr(settings, 'MEDIA_URL', '') MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT', '') SITE_ID = getattr(settings, 'SITE_ID', 1) diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/static/ldt/img/logo_facebook.png Binary file src/ldt/ldt/static/ldt/img/logo_facebook.png has changed diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/static/ldt/img/logo_google.png Binary file src/ldt/ldt/static/ldt/img/logo_google.png has changed diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/static/ldt/img/logo_twitter.png Binary file src/ldt/ldt/static/ldt/img/logo_twitter.png has changed diff -r 6094ab306d77 -r 2affc8a44dfb src/ldt/ldt/static/ldt/img/logo_yahoo.png Binary file src/ldt/ldt/static/ldt/img/logo_yahoo.png has changed diff -r 6094ab306d77 -r 2affc8a44dfb web/ldtplatform/config.py.tmpl --- a/web/ldtplatform/config.py.tmpl Wed May 11 17:47:25 2011 +0200 +++ b/web/ldtplatform/config.py.tmpl Thu May 12 18:18:37 2011 +0200 @@ -5,8 +5,10 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" BASE_URL = '/~ymh/platform/' WEB_URL = 'http://localhost/' -STATIC_URL = BASE_URL + 'static/' -STREAM_URL = MEDIA_BASE_URL + "/content/" +STATIC_URL = BASE_URL + 'static/site/' + + +STREAM_URL = "rtmp://localhost/vod/media/" STREAM_SRC_PREFIX = "" @@ -21,20 +23,11 @@ STATIC_ROOT = "C:/user/myfolder/my_platform/platform/web/static" -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = STATIC_URL - CONTENT_ROOT = MEDIA_ROOT + "media/content/" +# PATH where uploaded media are put. STREAM_PATH = CONTENT_ROOT -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' -LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' DATABASES = { 'default': { @@ -77,4 +70,3 @@ EMPTY_MEDIA_EXTERNALID = None AUTO_INDEX_AFTER_SAVE = True - diff -r 6094ab306d77 -r 2affc8a44dfb web/ldtplatform/settings.py --- a/web/ldtplatform/settings.py Wed May 11 17:47:25 2011 +0200 +++ b/web/ldtplatform/settings.py Thu May 12 18:18:37 2011 +0200 @@ -50,6 +50,9 @@ # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '' +# Root of static files used by each app, generated by code or uploaded by users +STATIC_URL = '/static/' + # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" @@ -201,4 +204,13 @@ GLOBAL_LOG_LEVEL = LOG_LEVEL if not "GLOBAL_LOG_HANDLERS" in locals(): GLOBAL_LOG_HANDLERS = [{'handler':logging.FileHandler(LOG_FILE), 'format':"%(asctime)s - %(levelname)s : %(message)s"}] + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' +# Used in a lot of templates +LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' +# URL that handles the media served from MEDIA_ROOT. +MEDIA_URL = BASE_URL + 'static/media/' diff -r 6094ab306d77 -r 2affc8a44dfb web/static/.hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/static/.hgignore Thu May 12 18:18:37 2011 +0200 @@ -0,0 +1,5 @@ + +syntax: regexp +^media$ +syntax: regexp +^site$ \ No newline at end of file diff -r 6094ab306d77 -r 2affc8a44dfb web/static/site/.keepme