From: root Date: Fri, 8 Feb 2008 19:43:18 +0000 (+0100) Subject: * Add a BASE_DIR setting, that gets filled based on __file__. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=8021b0208f57dce74a08afb97fb62d5323fbd4ac;p=matthijs%2Fprojects%2Fxerxes.git * Add a BASE_DIR setting, that gets filled based on __file__. * Remove hardcoded absolute paths from settings and urlconf. --- diff --git a/settings.py b/settings.py index bef6aa8..ba3582d 100644 --- a/settings.py +++ b/settings.py @@ -1,6 +1,9 @@ # Django settings for ee project. from dbsettings import * +import os + +PROJECT_DIR = os.path.dirname(__file__) DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -78,7 +81,7 @@ 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. - '/home/matthijs/docs/src/django/ee/templates', + os.path.join(PROJECT_DIR, 'templates'), ) INSTALLED_APPS = ( diff --git a/urls.py b/urls.py index bffdb4f..d03ac11 100644 --- a/urls.py +++ b/urls.py @@ -2,6 +2,7 @@ from django.conf import settings from django.conf.urls.defaults import * from ee.influences.models import Character from ee.influences.models import Influence +import os chars_dict = { 'queryset': Character.objects.all(), @@ -32,5 +33,5 @@ urlpatterns = patterns('', if settings.DEBUG: urlpatterns += patterns('', (r'^static/(?P.*)$', 'django.views.static.serve', - {'document_root': '/home/matthijs/docs/src/django/ee/static/'}), + {'document_root': os.path.join(settings.PROJECT_DIR, 'static')}), )