settings, change all tuples to list and use explicit extend

This commit is contained in:
nitely 2015-07-12 19:38:17 -03:00
parent ef6983ce68
commit b2f1cdf29f
7 changed files with 39 additions and 52 deletions

View File

@ -10,34 +10,33 @@ import sys
from spirit.settings import *
# You may override spirit settings below...
# You may override or extend spirit settings below...
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# Application definition
# Extend the Spirit installed apps (notice the plus sign)
# Check out the spirit.settings.py so you do not end up with duplicate apps.
INSTALLED_APPS += (
# Extend the Spirit installed apps.
# Check out the spirit.settings.py so you do not end up with duplicated apps.
INSTALLED_APPS.extend([
# 'my_app1',
# 'my_app2',
)
])
# same here, check out the spirit.settings.py
MIDDLEWARE_CLASSES += (
MIDDLEWARE_CLASSES.extend([
# 'my_middleware1',
# 'my_middleware2',
)
])
# same here
TEMPLATES[0]['OPTIONS']['context_processors'] += [
TEMPLATES[0]['OPTIONS']['context_processors'].extend([
# 'my_template_proc1',
# 'my_template_proc2',
]
])
# same here (we update the Spirit caches)
CACHES.update({

View File

@ -23,9 +23,9 @@ SECRET_KEY = "DEV"
ALLOWED_HOSTS = ['127.0.0.1', ]
INSTALLED_APPS += (
INSTALLED_APPS.extend([
'debug_toolbar',
)
])
DATABASES = {
'default': {
@ -40,8 +40,8 @@ CACHES.update({
},
})
PASSWORD_HASHERS = (
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
)
]
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

View File

@ -23,11 +23,11 @@ SECRET_KEY = os.environ.get("SECRET_KEY", "")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['.example.com', ]
# Extend the Spirit installed apps (notice the plus sign)
# Extend the Spirit installed apps
# Check out the .base.py file for more examples
INSTALLED_APPS += (
INSTALLED_APPS.extend([
# 'my_app1',
)
])
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
@ -44,12 +44,12 @@ DATABASES = {
# These are all the languages Spirit provides.
# https://www.transifex.com/projects/p/spirit/
gettext_noop = lambda s: s
LANGUAGES = (
LANGUAGES = [
('de', gettext_noop('German')),
('en', gettext_noop('English')),
('es', gettext_noop('Spanish')),
('sv', gettext_noop('Swedish')),
)
]
# Default language
LANGUAGE_CODE = 'en'

View File

@ -12,9 +12,9 @@ from .base import *
SECRET_KEY = "TEST"
INSTALLED_APPS += (
INSTALLED_APPS.extend([
'spirit.core.tests',
)
])
DATABASES = {
'default': {
@ -25,6 +25,6 @@ DATABASES = {
ROOT_URLCONF = 'example.project.urls'
PASSWORD_HASHERS = (
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
)
]

View File

@ -37,9 +37,7 @@ ST_UNIQUE_EMAILS = True
# Django & Spirit settings defined below...
#
# TODO: change all tuples to list so we can do .extend(arg1, arag2, ...)
INSTALLED_APPS = (
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@ -49,8 +47,8 @@ INSTALLED_APPS = (
'spirit',
'spirit.core',
# 'spirit.tests'
)
# 'spirit.core.tests'
]
# python manage.py createcachetable
CACHES = {
@ -60,15 +58,15 @@ CACHES = {
},
}
AUTHENTICATION_BACKENDS = (
AUTHENTICATION_BACKENDS = [
'spirit.user.auth.backends.UsernameAuthBackend',
'spirit.user.auth.backends.EmailAuthBackend',
)
]
LOGIN_URL = 'spirit:user:auth:login'
LOGIN_REDIRECT_URL = 'spirit:user:update'
MIDDLEWARE_CLASSES = (
MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
@ -82,7 +80,7 @@ MIDDLEWARE_CLASSES = (
'spirit.user.middleware.LastSeenMiddleware',
'spirit.user.middleware.ActiveUserMiddleware',
'spirit.core.middleware.PrivateForumMiddleware',
)
]
TEMPLATES = [
{
@ -110,13 +108,13 @@ TEMPLATES = [
# django-djconfig
INSTALLED_APPS += (
INSTALLED_APPS += [
'djconfig',
)
]
MIDDLEWARE_CLASSES += (
MIDDLEWARE_CLASSES += [
'djconfig.middleware.DjConfigMiddleware',
)
]
TEMPLATES[0]['OPTIONS']['context_processors'] += [
'djconfig.context_processors.config',
@ -124,9 +122,9 @@ TEMPLATES[0]['OPTIONS']['context_processors'] += [
# django-haystack
INSTALLED_APPS += (
INSTALLED_APPS += [
'haystack',
)
]
HAYSTACK_CONNECTIONS = {
'default': {

View File

@ -12,9 +12,9 @@ from spirit.settings import *
SECRET_KEY = 'TEST'
INSTALLED_APPS += (
INSTALLED_APPS += [
'spirit.core.tests',
)
]
ROOT_URLCONF = 'spirit.urls'
@ -42,9 +42,9 @@ CACHES.update({
})
# speedup tests requiring login
PASSWORD_HASHERS = (
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
)
]
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

View File

@ -10,17 +10,7 @@ import spirit.user.urls
import spirit.search.urls
import spirit.category.urls
import spirit.topic.urls
import spirit.topic.moderate.urls
import spirit.topic.unread.urls
import spirit.topic.notification.urls
import spirit.topic.favorite.urls
import spirit.topic.private.urls
import spirit.topic.poll.urls
import spirit.comment.urls
import spirit.comment.bookmark.urls
import spirit.comment.flag.urls
import spirit.comment.history.urls
import spirit.comment.like.urls
patterns = [