From 6c74d7c9389a009ecda329c445d8f15c75326229 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 23 Aug 2018 15:19:29 +0200 Subject: [PATCH] move settings from __init__.py --- src/wolnelektury/settings/__init__.py | 101 +------------------------- src/wolnelektury/settings/apps.py | 78 ++++++++++++++++++++ src/wolnelektury/settings/basic.py | 20 +++++ src/wolnelektury/settings/contrib.py | 4 + 4 files changed, 103 insertions(+), 100 deletions(-) create mode 100644 src/wolnelektury/settings/apps.py diff --git a/src/wolnelektury/settings/__init__.py b/src/wolnelektury/settings/__init__.py index b57ca5545..78b556d78 100644 --- a/src/wolnelektury/settings/__init__.py +++ b/src/wolnelektury/settings/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # Django settings for wolnelektury project. +from .apps import * from .basic import * from .auth import * from .cache import * @@ -10,106 +11,6 @@ from .locale import * from .static import * from .paths import * - -MIDDLEWARE_CLASSES = [ - 'django.middleware.csrf.CsrfViewMiddleware', - 'ssify.middleware.SsiMiddleware', - 'django.middleware.cache.UpdateCacheMiddleware', - 'ssify.middleware.PrepareForCacheMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.admindocs.middleware.XViewMiddleware', - 'fnp_django_pagination.middleware.PaginationMiddleware', - 'ssify.middleware.LocaleMiddleware', - 'maintenancemode.middleware.MaintenanceModeMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'fnpdjango.middleware.SetRemoteAddrFromXRealIP', - 'django.middleware.cache.FetchFromCacheMiddleware', -] - -ROOT_URLCONF = 'wolnelektury.urls' - -# These are the ones we should test. -INSTALLED_APPS_OUR = [ - 'wolnelektury', - # our - 'ajaxable', - 'api', - 'catalogue', - 'chunks', - 'dictionary', - 'infopages', - 'lesmianator', - 'newtagging', - 'opds', - 'pdcounter', - 'reporting', - 'sponsors', - 'stats', - 'suggest', - 'picture', - 'social', - 'waiter', - 'search', - 'oai', - 'funding', - 'polls', - 'libraries', - 'newsletter', - 'contact', - 'isbn', - 'paypal', -] - -GETPAID_BACKENDS = ( - 'getpaid.backends.payu', -) - -INSTALLED_APPS_CONTRIB = [ - # Should be before django.contrib.admin - 'modeltranslation', - - # external - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.admindocs', - 'django.contrib.staticfiles', - 'fnp_django_pagination', - 'pipeline', - 'piston', - 'piwik', - 'sorl.thumbnail', - 'kombu.transport.django', - 'honeypot', - 'fnpdjango', - 'getpaid', - 'getpaid.backends.payu', - 'ssify', - 'django_extensions', - 'raven.contrib.django.raven_compat', - - 'migdal', - 'django_comments', - 'django_comments_xtd', - - # allauth stuff - 'uni_form', - 'allauth', - 'allauth.account', - 'allauth.socialaccount', - 'allauth.socialaccount.providers.openid', - 'allauth.socialaccount.providers.facebook', - 'allauth.socialaccount.providers.google', - # 'allauth.socialaccount.providers.twitter', - ] - -INSTALLED_APPS = INSTALLED_APPS_OUR + INSTALLED_APPS_CONTRIB - # Load localsettings, if they exist try: from wolnelektury.localsettings import * diff --git a/src/wolnelektury/settings/apps.py b/src/wolnelektury/settings/apps.py new file mode 100644 index 000000000..cb56d2440 --- /dev/null +++ b/src/wolnelektury/settings/apps.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +# These are the ones we should test. +INSTALLED_APPS_OUR = [ + 'wolnelektury', + # our + 'ajaxable', + 'api', + 'catalogue', + 'chunks', + 'dictionary', + 'infopages', + 'lesmianator', + 'newtagging', + 'opds', + 'pdcounter', + 'reporting', + 'sponsors', + 'stats', + 'suggest', + 'picture', + 'social', + 'waiter', + 'search', + 'oai', + 'funding', + 'polls', + 'libraries', + 'newsletter', + 'contact', + 'isbn', + 'paypal', +] + +INSTALLED_APPS_CONTRIB = [ + # Should be before django.contrib.admin + 'modeltranslation', + + # external + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.admindocs', + 'django.contrib.staticfiles', + 'fnp_django_pagination', + 'pipeline', + 'piston', + 'piwik', + 'sorl.thumbnail', + 'kombu.transport.django', + 'honeypot', + 'fnpdjango', + 'getpaid', + 'getpaid.backends.payu', + 'ssify', + 'django_extensions', + 'raven.contrib.django.raven_compat', + + 'migdal', + 'django_comments', + 'django_comments_xtd', + + # allauth stuff + 'uni_form', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'allauth.socialaccount.providers.openid', + 'allauth.socialaccount.providers.facebook', + 'allauth.socialaccount.providers.google', + # 'allauth.socialaccount.providers.twitter', +] + +INSTALLED_APPS = INSTALLED_APPS_OUR + INSTALLED_APPS_CONTRIB diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index 32b48f299..7990f2535 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -58,3 +58,23 @@ TEMPLATES = [{ ), }, }] + +MIDDLEWARE_CLASSES = [ + 'django.middleware.csrf.CsrfViewMiddleware', + 'ssify.middleware.SsiMiddleware', + 'django.middleware.cache.UpdateCacheMiddleware', + 'ssify.middleware.PrepareForCacheMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.admindocs.middleware.XViewMiddleware', + 'fnp_django_pagination.middleware.PaginationMiddleware', + 'ssify.middleware.LocaleMiddleware', + 'maintenancemode.middleware.MaintenanceModeMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'fnpdjango.middleware.SetRemoteAddrFromXRealIP', + 'django.middleware.cache.FetchFromCacheMiddleware', +] + +ROOT_URLCONF = 'wolnelektury.urls' diff --git a/src/wolnelektury/settings/contrib.py b/src/wolnelektury/settings/contrib.py index 70eca9e0c..b0165c3de 100644 --- a/src/wolnelektury/settings/contrib.py +++ b/src/wolnelektury/settings/contrib.py @@ -18,6 +18,10 @@ MIGRATION_MODULES = { GETPAID_ORDER_DESCRIPTION = "{% load funding_tags %}{{ order|sanitize_payment_title }}" +GETPAID_BACKENDS = ( + 'getpaid.backends.payu', +) + PIWIK_URL = '' PIWIK_SITE_ID = 0 PIWIK_TOKEN = '' -- 2.20.1