Updated settings.py.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Wed, 02 Sep 2009 20:17:47 +0530
changeset 5 962b45987a02
parent 4 ac11fee16880
child 6 eb8e00312877
child 7 e49daa7af035
Updated settings.py.
settings.py
urls.py
--- a/settings.py	Wed Sep 02 10:38:24 2009 -0400
+++ b/settings.py	Wed Sep 02 20:17:47 2009 +0530
@@ -36,14 +36,16 @@
 # to load the internationalization machinery.
 USE_I18N = True
 
+ROOT_PATH = os.path.dirname(__file__)
+
 # Absolute path to the directory that holds media.
 # Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = ''
+MEDIA_ROOT = os.path.join(ROOT_PATH, 'site-content')
 
 # 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 = ''
+MEDIA_URL = '/site-content/'
 
 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
 # trailing slash.
@@ -69,7 +71,7 @@
 ROOT_URLCONF = 'spoken_tut.urls'
 
 TEMPLATE_DIRS = (
-       '/home/hg/repos/spoken_tut/template',
+    os.path.join(ROOT_PATH, 'template'),
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
--- a/urls.py	Wed Sep 02 10:38:24 2009 -0400
+++ b/urls.py	Wed Sep 02 20:17:47 2009 +0530
@@ -16,5 +16,5 @@
     # (r'^admin/(.*)', admin.site.root),
 	(r'^$','spoken_tut.upload.views.upload_file'),
 	(r'^download/$','spoken_tut.upload.views.file_archive'),
-	(r'^(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'template/'}),
+	(r'^(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
 )