From 39f5bb609a3254a6a853624617a3e20e6dd9fd90 Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Tue, 28 Aug 2012 12:45:32 -0400 Subject: [PATCH] Don't hardcode a full path to TEMPLATE_DIRS, so it can be deployed anywhere. (imported from commit 35deb40218d1626d38e00924a787234ec13732e3) --- humbug/settings.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/humbug/settings.py b/humbug/settings.py index 0c034527ee..84e5ef1d97 100644 --- a/humbug/settings.py +++ b/humbug/settings.py @@ -1,4 +1,5 @@ # Django settings for humbug project. +import os DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -43,9 +44,9 @@ USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = '' +SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) +TEMPLATE_DIRS = ( os.path.join(SITE_ROOT, '..', 'templates'),) +print TEMPLATE_DIRS # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. @@ -102,13 +103,6 @@ ROOT_URLCONF = 'humbug.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'humbug.wsgi.application' -TEMPLATE_DIRS = ( - # 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. - '/Users/jesstess/dev/humbug/templates', -) - INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes',