* Add a BASE_DIR setting, that gets filled based on __file__.
authorroot <root@stdio.flexvps.nl>
Fri, 8 Feb 2008 19:43:18 +0000 (20:43 +0100)
committerroot <root@stdio.flexvps.nl>
Fri, 8 Feb 2008 19:43:18 +0000 (20:43 +0100)
 * Remove hardcoded absolute paths from settings and urlconf.

settings.py
urls.py

index bef6aa8e11d3730ab9c7d5bbef722ddd487d2fc5..ba3582d320d897fbe6efcfa3e3004da143b456fa 100644 (file)
@@ -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 bffdb4fba5826badd0918351cddc703a8cd09252..d03ac119ec8080889ef173d6d595d0bc55204433 100644 (file)
--- 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<path>.*)$', 'django.views.static.serve',
-        {'document_root': '/home/matthijs/docs/src/django/ee/static/'}),
+        {'document_root': os.path.join(settings.PROJECT_DIR, 'static')}),
     )