Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
authorcavaliet
Thu, 12 May 2011 18:18:37 +0200
changeset 106 2affc8a44dfb
parent 105 6094ab306d77
child 107 13744108acae
Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
src/ldt/ldt/ldt_utils/models.py
src/ldt/ldt/settings.py
src/ldt/ldt/static/ldt/img/logo_facebook.png
src/ldt/ldt/static/ldt/img/logo_google.png
src/ldt/ldt/static/ldt/img/logo_twitter.png
src/ldt/ldt/static/ldt/img/logo_yahoo.png
web/ldtplatform/config.py.tmpl
web/ldtplatform/settings.py
web/static/.hgignore
web/static/site/.keepme
--- 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):
--- 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)
Binary file src/ldt/ldt/static/ldt/img/logo_facebook.png has changed
Binary file src/ldt/ldt/static/ldt/img/logo_google.png has changed
Binary file src/ldt/ldt/static/ldt/img/logo_twitter.png has changed
Binary file src/ldt/ldt/static/ldt/img/logo_yahoo.png has changed
--- 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
-
--- 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/'
--- /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