diff options
Diffstat (limited to 'example_project/settings.py')
-rw-r--r-- | example_project/settings.py | 105 |
1 files changed, 59 insertions, 46 deletions
diff --git a/example_project/settings.py b/example_project/settings.py index c7880d8c8..ea50daffb 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -7,10 +7,11 @@ import sys DEBUG = False DEBUG_TOOLBAR = False -TEMPLATE_DEBUG = DEBUG +DEBUG_TO_CONSOLE = False SQL_DEBUG = False DJANGO_EXTENSIONS = False -USE_SPATIALITE_FOR_TESTS = True +USE_SPATIALITE_FOR_TESTS = False +TEST_VIEWS = True if "test" in sys.argv: sys.path.insert(0, '..') @@ -31,11 +32,14 @@ BASE_URL = "/" URL_PATH = "" EXTRA_VERSION = 'git' +STATICFILES_DIRS = ( + ROOT_PATH + "../static/", +) + ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt" LOGIN_REDIRECT_URL = "/" + URL_PATH -AUTH_PROFILE_MODULE = 'ishtar_common.IshtarUser' ACCOUNT_ACTIVATION_DAYS = 7 # change this in local_settings @@ -93,14 +97,7 @@ MEDIA_ROOT = ROOT_PATH + 'media/' # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/media/' -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - # 'django.template.loaders.eggs.Loader', -) - -MIDDLEWARE_CLASSES = [ +MIDDLEWARE = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -109,21 +106,29 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.locale.LocaleMiddleware', ] -TEMPLATE_CONTEXT_PROCESSORS = ( - 'ishtar_common.context_processors.get_base_context', - "django.contrib.auth.context_processors.auth", - "django.core.context_processors.debug", - "django.core.context_processors.i18n", - "django.core.context_processors.media", - "django.core.context_processors.static", - "django.core.context_processors.request", -) +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(ROOT_PATH, 'templates')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + 'ishtar_common.context_processors.get_base_context', + "django.contrib.auth.context_processors.auth", + 'django.contrib.messages.context_processors.messages', + "django.template.context_processors.i18n", + "django.template.context_processors.media", + "django.template.context_processors.static", + "django.template.context_processors.csrf" + ], + }, + }, +] -ROOT_URLCONF = 'example_project.urls' -TEMPLATE_DIRS = ( - ROOT_PATH + 'templates', -) +ROOT_URLCONF = 'example_project.urls' AUTHENTICATION_BACKENDS = ( 'ishtar_common.backend.ObjectPermBackend', @@ -137,10 +142,8 @@ INSTALLED_APPS = [ 'django.contrib.sites', 'django.contrib.gis', 'django.contrib.staticfiles', - 'django.contrib.formtools', 'django.contrib.messages', 'django.contrib.humanize', - 'south', 'registration', # 'geodjangofla', 'ishtar_pdl', @@ -151,6 +154,7 @@ INSTALLED_APPS = [ 'archaeological_context_records', 'archaeological_warehouse', 'archaeological_finds', + 'ajax_select', # 'debug_toolbar', ] @@ -195,6 +199,11 @@ LOGGING = { 'level': 'ERROR', 'propagate': False, }, + 'django.server': { + 'handlers': ['console'], + 'level': 'INFO', + 'propagate': False, + }, 'ishtar_pdl': default_handler, 'ishtar_common': default_handler, 'archaeological_files_pdl': default_handler, @@ -234,9 +243,6 @@ ISHTAR_DOC_TYPES = {u"undefined": u"Undefined"} ISHTAR_DPTS = [] -PRE_APPS = [] -EXTRA_APPS = [] - TEST_RUNNER = 'ishtar_common.tests.ManagedModelTestRunner' try: @@ -246,12 +252,9 @@ except ImportError, e: TESTING = sys.argv[1:2] == ['test'] -if TESTING: - SOUTH_TESTS_MIGRATE = False - - if USE_SPATIALITE_FOR_TESTS: - DATABASES['default']['ENGINE'] = \ - 'django.contrib.gis.db.backends.spatialite' +# if TESTING and USE_SPATIALITE_FOR_TESTS: +# DATABASES['default']['ENGINE'] = \ +# 'django.contrib.gis.db.backends.spatialite' PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default') @@ -269,7 +272,10 @@ JQUERY_UI_URL = STATIC_URL + "js/jquery-ui/" if DEBUG: # make all loggers use the console for logger in LOGGING['loggers']: - LOGGING['loggers'][logger]['handlers'] += ['console'] + if DEBUG_TO_CONSOLE: + LOGGING['loggers'][logger]['handlers'] = ['console'] + elif 'console' not in LOGGING['loggers'][logger]['handlers']: + LOGGING['loggers'][logger]['handlers'] += ['console'] if DJANGO_EXTENSIONS: INSTALLED_APPS.append('django_extensions') @@ -279,18 +285,21 @@ if DEBUG_TOOLBAR: sys.path.insert(0, '..') global DEBUG_TOOLBAR_PANELS global DEBUG_TOOLBAR_CONFIG - MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware'] + MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware'] INSTALLED_APPS += ['debug_toolbar'] 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', + 'debug_toolbar.panels.versions.VersionsPanel', + 'debug_toolbar.panels.timer.TimerPanel', + 'debug_toolbar.panels.settings.SettingsPanel', + 'debug_toolbar.panels.headers.HeadersPanel', + 'debug_toolbar.panels.request.RequestPanel', + 'debug_toolbar.panels.sql.SQLPanel', + 'debug_toolbar.panels.staticfiles.StaticFilesPanel', + 'debug_toolbar.panels.templates.TemplatesPanel', + 'debug_toolbar.panels.cache.CachePanel', + 'debug_toolbar.panels.signals.SignalsPanel', + 'debug_toolbar.panels.logging.LoggingPanel', + 'debug_toolbar.panels.redirects.RedirectsPanel', ) DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False} @@ -303,3 +312,7 @@ if SQL_DEBUG: if 'test' in sys.argv: PROJECT_SLUG += "-test" + +if not DEBUG: + # persistent connection + DATABASES['default']['CONN_MAX_AGE'] = 600 |