2009-11-23 03:58:30 +05:30
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
|
|
|
# Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
|
|
|
""" Django settings for gramps project. """
|
|
|
|
|
|
|
|
# Need to be able to import Gramps files from here.
|
2009-11-10 10:58:35 +05:30
|
|
|
|
2009-11-10 18:34:14 +05:30
|
|
|
import const
|
|
|
|
import os
|
|
|
|
|
2011-02-19 08:06:20 +05:30
|
|
|
DEBUG = True
|
2009-11-10 10:58:35 +05:30
|
|
|
TEMPLATE_DEBUG = DEBUG
|
|
|
|
|
2009-11-16 04:17:43 +05:30
|
|
|
INTERNAL_IPS = ('127.0.0.1',)
|
|
|
|
|
2009-11-10 10:58:35 +05:30
|
|
|
ADMINS = (
|
|
|
|
('admin', 'your_email@domain.com'),
|
|
|
|
)
|
|
|
|
|
|
|
|
MANAGERS = ADMINS
|
2010-08-16 09:01:40 +05:30
|
|
|
DATABASE_ROUTERS = []
|
2010-08-16 05:46:16 +05:30
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
'NAME': os.path.join(const.WEB_DIR, 'sqlite.db'),
|
|
|
|
}
|
|
|
|
}
|
2009-11-10 10:58:35 +05:30
|
|
|
DATABASE_ENGINE = 'sqlite3'
|
2009-11-10 18:34:14 +05:30
|
|
|
DATABASE_NAME = os.path.join(const.WEB_DIR, 'sqlite.db')
|
2009-11-10 10:58:35 +05:30
|
|
|
DATABASE_USER = ''
|
|
|
|
DATABASE_PASSWORD = ''
|
|
|
|
DATABASE_HOST = ''
|
|
|
|
DATABASE_PORT = ''
|
|
|
|
TIME_ZONE = 'America/New_York'
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
SITE_ID = 1
|
|
|
|
USE_I18N = True
|
|
|
|
MEDIA_ROOT = ''
|
|
|
|
MEDIA_URL = ''
|
|
|
|
ADMIN_MEDIA_PREFIX = '/gramps-media/'
|
|
|
|
SECRET_KEY = 'zd@%vslj5sqhx94_8)0hsx*rk9tj3^ly$x+^*tq4bggr&uh$ac'
|
|
|
|
|
|
|
|
TEMPLATE_LOADERS = (
|
|
|
|
'django.template.loaders.filesystem.load_template_source',
|
|
|
|
'django.template.loaders.app_directories.load_template_source',
|
|
|
|
)
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = (
|
2010-08-18 08:06:26 +05:30
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
2009-11-10 10:58:35 +05:30
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
2009-11-16 04:17:43 +05:30
|
|
|
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
|
2009-11-10 10:58:35 +05:30
|
|
|
)
|
|
|
|
|
2009-11-10 19:53:19 +05:30
|
|
|
ROOT_URLCONF = 'web.urls'
|
2009-11-10 10:58:35 +05:30
|
|
|
|
|
|
|
TEMPLATE_DIRS = (
|
|
|
|
# Use absolute paths, not relative paths.
|
2009-11-10 18:34:14 +05:30
|
|
|
os.path.join(const.DATA_DIR, "templates"),
|
2009-11-10 10:58:35 +05:30
|
|
|
)
|
|
|
|
|
2009-11-11 21:48:01 +05:30
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
|
|
"django.core.context_processors.auth",
|
2010-05-14 14:29:36 +05:30
|
|
|
# "django.core.context_processors.debug",
|
2009-11-11 21:48:01 +05:30
|
|
|
"django.core.context_processors.i18n",
|
|
|
|
"django.core.context_processors.media",
|
|
|
|
"web.grampsdb.views.context_processor",
|
|
|
|
)
|
|
|
|
|
2009-11-10 10:58:35 +05:30
|
|
|
INSTALLED_APPS = (
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.sites',
|
|
|
|
'django.contrib.admin',
|
2009-11-10 19:53:19 +05:30
|
|
|
'web.grampsdb',
|
2009-11-10 10:58:35 +05:30
|
|
|
# 'django_extensions',
|
2009-11-16 04:17:43 +05:30
|
|
|
# 'debug_toolbar',
|
2009-11-10 10:58:35 +05:30
|
|
|
)
|
|
|
|
|
2009-11-22 19:13:40 +05:30
|
|
|
DEBUG_TOOLBAR_PANELS = (
|
|
|
|
'debug_toolbar.panels.version.VersionDebugPanel',
|
|
|
|
'debug_toolbar.panels.timer.TimerDebugPanel',
|
|
|
|
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
|
|
|
|
'debug_toolbar.panels.headers.HeaderDebugPanel',
|
|
|
|
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
|
|
|
|
'debug_toolbar.panels.template.TemplateDebugPanel',
|
|
|
|
'debug_toolbar.panels.sql.SQLDebugPanel',
|
|
|
|
'debug_toolbar.panels.signals.SignalDebugPanel',
|
|
|
|
'debug_toolbar.panels.logger.LoggingPanel',
|
|
|
|
)
|
|
|
|
|
|
|
|
def custom_show_toolbar(request):
|
|
|
|
return True # Always show toolbar, for example purposes only.
|
|
|
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
'INTERCEPT_REDIRECTS': False,
|
|
|
|
# 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar,
|
|
|
|
# 'EXTRA_SIGNALS': ['myproject.signals.MySignal'],
|
|
|
|
'HIDE_DJANGO_SQL': False,
|
|
|
|
}
|
2009-11-16 04:17:43 +05:30
|
|
|
|
2010-01-02 22:04:37 +05:30
|
|
|
AUTH_PROFILE_MODULE = "grampsdb.Profile"
|
|
|
|
|
2009-11-10 10:58:35 +05:30
|
|
|
# Had to add these to use settings.configure():
|
|
|
|
DATABASE_OPTIONS = ''
|
|
|
|
URL_VALIDATOR_USER_AGENT = ''
|
|
|
|
DEFAULT_INDEX_TABLESPACE = ''
|
|
|
|
DEFAULT_TABLESPACE = ''
|
|
|
|
CACHE_BACKEND = 'locmem://'
|
|
|
|
TRANSACTIONS_MANAGED = False
|
|
|
|
LOCALE_PATHS = tuple()
|
|
|
|
|
2011-10-13 16:02:27 +05:30
|
|
|
# In versions < 2.7 python does not properly copy methods when doing a
|
|
|
|
# deepcopy. This workaround makes the copy work properly. When Gramps no longer
|
|
|
|
# supports python 2.6, this workaround can be removed.
|
|
|
|
import sys
|
|
|
|
if sys.version_info < (2, 7) :
|
|
|
|
import copy
|
|
|
|
import types
|
|
|
|
def _deepcopy_method(x, memo):
|
|
|
|
return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class)
|
|
|
|
copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method
|