0b0276b6360b

Cleaned up the silly hardcoding of the BASE_DIR.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 08 Apr 2009 18:54:18 -0400
parents ed9aff132907
children 304d881c8458
branches/tags (none)
files deploy-template.py settings.py

Changes

--- a/deploy-template.py	Fri Mar 27 18:28:41 2009 -0400
+++ b/deploy-template.py	Wed Apr 08 18:54:18 2009 -0400
@@ -13,9 +13,6 @@
 # start a new project.
 SECRET_KEY = ''
 
-# Make sure it ends in a trailing slash! 
-BASE_DIR = '/full/path/to/project/directory/'
-
 # This is used for the Mint (http://haveamint.com/) Bird Feeder plugin hack.
 FEEDER_PASSWORD = ''
 
--- a/settings.py	Fri Mar 27 18:28:41 2009 -0400
+++ b/settings.py	Wed Apr 08 18:54:18 2009 -0400
@@ -1,4 +1,5 @@
 from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
+import os
 import deploy
 
 
@@ -36,11 +37,11 @@
 USE_I18N = True
 
 # Base directory.
-BASE_DIR = deploy.BASE_DIR
+BASE_DIR = os.path.dirname(__file__)
 
 # Absolute path to the directory that holds media.
 # Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = BASE_DIR + 'site-media/'
+MEDIA_ROOT = os.path.join(BASE_DIR, 'site-media/')
 
 # 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).
@@ -74,7 +75,7 @@
 ROOT_URLCONF = 'stevelosh.urls'
 
 TEMPLATE_DIRS = (
-    BASE_DIR + 'templates/',
+    os.path.join(BASE_DIR, 'templates/'),
 )
 
 TEMPLATE_CONTEXT_PROCESSORS += (