diff --git a/src/gen/web/Makefile b/src/gen/web/Makefile index 7a6b9767f..ba0f9f08a 100644 --- a/src/gen/web/Makefile +++ b/src/gen/web/Makefile @@ -10,7 +10,7 @@ init_gramps: python init_gramps.py # clear primary and secondary tables run: - python manage.py runserver + PYTHONPATH=../../../src python manage.py runserver sql: python manage.py sqlall > gramps_sql.txt diff --git a/src/gen/web/settings.py b/src/gen/web/settings.py index f3e17b533..e621a6284 100644 --- a/src/gen/web/settings.py +++ b/src/gen/web/settings.py @@ -1,5 +1,8 @@ # Django settings for gramps project. +import const +import os + DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -9,7 +12,7 @@ ADMINS = ( MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' -DATABASE_NAME = '/home/dblank/gramps/trunk/src/gen/web/sqlite.db' +DATABASE_NAME = os.path.join(const.WEB_DIR, 'sqlite.db') DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' @@ -38,7 +41,7 @@ ROOT_URLCONF = 'gen.web.urls' TEMPLATE_DIRS = ( # Use absolute paths, not relative paths. - "/home/dblank/gramps/trunk/src/data/templates", + os.path.join(const.DATA_DIR, "templates"), ) INSTALLED_APPS = ( diff --git a/src/gen/web/urls.py b/src/gen/web/urls.py index 3864bd0ee..28dad85f0 100644 --- a/src/gen/web/urls.py +++ b/src/gen/web/urls.py @@ -1,5 +1,8 @@ -from django.conf.urls.defaults import * +import os +import const + +from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() @@ -14,16 +17,12 @@ urlpatterns = patterns('', urlpatterns += patterns('', # Static serves! DANGEROUS in production: (r'^styles/(?P.*)$', 'django.views.static.serve', - {'document_root': - '/home/dblank/gramps/trunk/src/data', - 'show_indexes': - True}, + {'document_root': const.DATA_DIR, + 'show_indexes': True}, ), (r'^images/(?P.*)$', 'django.views.static.serve', - {'document_root': - '/home/dblank/gramps/trunk/src/images', - 'show_indexes': - True}, + {'document_root': const.IMAGE_DIR, + 'show_indexes': True}, ), )