From: Guillaume Pellerin Date: Thu, 26 Oct 2017 11:41:31 +0000 (+0200) Subject: Fix various settings X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f826b6f5e75f6833a5c1139f7db5be96209a717f;p=mezzo.git Fix various settings --- diff --git a/app/settings.py b/app/settings.py index 818ed0dc..337697e2 100644 --- a/app/settings.py +++ b/app/settings.py @@ -21,6 +21,7 @@ from __future__ import absolute_import, unicode_literals + import os from django.utils.translation import ugettext_lazy as _ @@ -81,6 +82,8 @@ PAGE_MENU_TEMPLATES = ( ) +MENU_PERSON_ID = 7 + # A sequence of fields that will be injected into Mezzanine's (or any # library's) models. Each item in the sequence is a four item sequence. # The first two items are the dotted path to the model and its field @@ -153,7 +156,8 @@ SITE_ID = 1 USE_I18N = True USE_L10N = True -AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend",) +AUTHENTICATION_BACKENDS = ("mezzanine.core.auth_backends.MezzanineBackend", + "guardian.backends.ObjectPermissionBackend",) ############# # DATABASES # @@ -216,12 +220,10 @@ ROOT_URLCONF = "urls" INSTALLED_APPS = [ "organization_themes", "organization_themes.www_ircam_fr", - "modeltranslation", "dal", "dal_select2", "dal_queryset_sequence", - "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", @@ -231,7 +233,6 @@ INSTALLED_APPS = [ "django.contrib.staticfiles", "django.contrib.sitemaps", 'django_extensions', - "mezzanine.boot", "mezzanine.conf", "mezzanine.core", @@ -258,9 +259,13 @@ INSTALLED_APPS = [ "organization.job", "sorl.thumbnail", # required for thumbnail support "django_instagram", + 'hijack', + 'compat', + 'hijack_admin', + 'guardian', + 'extra_views', ] - BOWER_COMPONENTS_ROOT = '/srv/bower/' BOWER_PATH = '/usr/local/bin/bower' BOWER_INSTALLED_APPS = ( @@ -292,7 +297,7 @@ TEMPLATES = [{'APP_DIRS': True, 'django.core.context_processors.tz', 'mezzanine.conf.context_processors.settings', 'mezzanine.pages.context_processors.page', - 'organization.core.context_processors.settings', + 'organization.core.context_processors.organization_settings', ) } }] @@ -359,6 +364,26 @@ GRAPH_MODELS = { SLUGIFY = 'django.template.defaultfilters.slugify' + +######## +# DRUM # +######## + +# Drum-specific Mezzanine settings +# ACCOUNTS_PROFILE_MODEL = "links.Profile" +# SITE_TITLE = "IRCAM" +RATINGS_RANGE = (-1, 1) +COMMENTS_ACCOUNT_REQUIRED = True +RATINGS_ACCOUNT_REQUIRED = True +ACCOUNTS_PROFILE_VIEWS_ENABLED = False +# SEARCH_MODEL_CHOICES = ("links.Link",) + +# Drum settings +ALLOWED_DUPLICATE_LINK_HOURS = 24 * 7 * 3 +ITEMS_PER_PAGE = 20 +LINK_REQUIRED = False +AUTO_TAG = True + ######################### # FILE BROWSER # ######################### @@ -538,27 +563,41 @@ OPTIONAL_APPS = ( PACKAGE_NAME_GRAPPELLI, ) +# if DEBUG: +# OPTIONAL_APPS += ("debug_toolbar",) +# +# DEBUG_TOOLBAR_PATCH_SETTINGS = False +# DEBUG_TOOLBAR_PANELS = [ +# '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', +# ] + if DEBUG: - OPTIONAL_APPS += ("debug_toolbar",) - DEBUG_TOOLBAR_CONFIG = { - 'SHOW_TOOLBAR_CALLBACK': lambda x : True - } + HIJACK_REGISTER_ADMIN = True + HIJACK_ALLOW_GET_REQUESTS = True +else: + HIJACK_REGISTER_ADMIN = False + HIJACK_ALLOW_GET_REQUESTS = False + +# HIJACK +if DEBUG : + SILENCED_SYSTEM_CHECKS = [] + HIJACK_LOGIN_REDIRECT_URL = "/person" + HIJACK_LOGOUT_REDIRECT_URL = "/" + HIJACK_ALLOW_GET_REQUESTS = True + HIJACK_DISPLAY_WARNING = True + HIJACK_REGISTER_ADMIN = True -DEBUG_TOOLBAR_PATCH_SETTINGS = False -DEBUG_TOOLBAR_PANELS = [ - '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', -] ################## # LOCAL SETTINGS # diff --git a/docker-compose.yml b/docker-compose.yml index 7610f4a0..b5be92a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,7 @@ app: volumes: - ./app:/srv/app - ./lib:/srv/lib + - .git:/srv/.git volumes_from: - var expose: diff --git a/lib/mezzanine-agenda b/lib/mezzanine-agenda index 8fff1fb8..d8154b63 160000 --- a/lib/mezzanine-agenda +++ b/lib/mezzanine-agenda @@ -1 +1 @@ -Subproject commit 8fff1fb82efa8de8c209ae219b1209d6a6deabd0 +Subproject commit d8154b63c2e485044e0f04481d996922490546a5