forked from django-wiki/django-wiki
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactore testproject.settings to accommodate more scenarios
- Loading branch information
1 parent
a4e3ebf
commit 58a46b8
Showing
5 changed files
with
59 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
from os import path as os_path | ||
PROJECT_PATH = os_path.abspath(os_path.split(__file__)[0]) | ||
PROJECT_PATH = os_path.abspath(os_path.split(os_path.dirname(__file__))[0]) | ||
|
||
DEBUG = True | ||
TEMPLATE_DEBUG = DEBUG | ||
|
@@ -9,9 +9,6 @@ | |
# ('Your Name', '[email protected]'), | ||
) | ||
|
||
#from django.core.urlresolvers import reverse_lazy | ||
#LOGIN_REDIRECT_URL = reverse_lazy('wiki:get', kwargs={'path': ''}) | ||
|
||
MANAGERS = ADMINS | ||
|
||
DATABASES = { | ||
|
@@ -21,12 +18,6 @@ | |
} | ||
} | ||
|
||
#Django Haystack | ||
|
||
HAYSTACK_SEARCH_ENGINE = 'whoosh' | ||
HAYSTACK_WHOOSH_PATH = os_path.join(PROJECT_PATH, 'index_woosh') | ||
HAYSTACK_SITECONF = 'testproject.search_sites' | ||
|
||
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name | ||
TIME_ZONE = 'Europe/Copenhagen' | ||
|
||
|
@@ -52,23 +43,21 @@ | |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', | ||
) | ||
|
||
SECRET_KEY = 'b^fv_)t39h%9p40)fnkfblo##jkr!$0)lkp6bpy!fi*f$4*92!' | ||
|
||
TEMPLATE_LOADERS = ( | ||
'django.template.loaders.filesystem.Loader', | ||
'django.template.loaders.app_directories.Loader', | ||
# 'django.template.loaders.eggs.Loader', | ||
) | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
MIDDLEWARE_CLASSES = [ | ||
'django.middleware.common.CommonMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
# Uncomment the next line for simple clickjacking protection: | ||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
) | ||
] | ||
|
||
ROOT_URLCONF = 'testproject.urls' | ||
|
||
|
@@ -79,7 +68,7 @@ | |
os_path.join(PROJECT_PATH, 'templates'), | ||
) | ||
|
||
TEMPLATE_CONTEXT_PROCESSORS =( | ||
TEMPLATE_CONTEXT_PROCESSORS = [ | ||
'django.contrib.auth.context_processors.auth', | ||
'django.core.context_processors.debug', | ||
'django.core.context_processors.i18n', | ||
|
@@ -90,9 +79,9 @@ | |
'django.core.context_processors.request', | ||
'django.contrib.messages.context_processors.messages', | ||
'sekizai.context_processors.sekizai', | ||
) | ||
] | ||
|
||
INSTALLED_APPS = ( | ||
INSTALLED_APPS = [ | ||
'django.contrib.humanize', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
|
@@ -114,8 +103,7 @@ | |
'wiki.plugins.attachments', | ||
'wiki.plugins.notifications', | ||
'mptt', | ||
'haystack', | ||
) | ||
] | ||
|
||
# A sample logging configuration. The only tangible logging | ||
# performed by this configuration is to send an email to | ||
|
@@ -150,9 +138,10 @@ | |
WIKI_ANONYMOUS_CREATE = False | ||
|
||
# Do not user /accounts/profile as default | ||
LOGIN_REDIRECT_URL = "/" | ||
#LOGIN_REDIRECT_URL = "/" | ||
from django.core.urlresolvers import reverse_lazy | ||
LOGIN_REDIRECT_URL = reverse_lazy('wiki:get', kwargs={'path': ''}) | ||
|
||
from settings_local import * | ||
|
||
try: | ||
import debug_toolbar #@UnusedImport | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from testproject.settings import * | ||
from testproject.settings.local import * | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. | ||
'NAME': os_path.join(PROJECT_PATH, 'db', 'prepopulated-customauthuser.db'), # Or path to database file if using sqlite3. | ||
} | ||
} | ||
|
||
INSTALLED_APPS = INSTALLED_APPS + [ | ||
# Test application for testing custom users | ||
'wiki.tests.testdata', | ||
] | ||
|
||
AUTH_USER_MODEL = 'testdata.CustomUser' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from testproject.settings import * | ||
from testproject.settings.local import * | ||
import os | ||
|
||
#Django Haystack | ||
|
||
HAYSTACK_WHOOSH_PATH = os.path.join(PROJECT_PATH, 'index_woosh') | ||
|
||
INSTALLED_APPS += ['haystack', 'wiki.plugins.haystack'] | ||
|
||
HAYSTACK_CONNECTIONS = { | ||
'default': { | ||
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', | ||
}, | ||
} | ||
HAYSTACK_CONNECTIONS = { | ||
'default': { | ||
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', | ||
'PATH': os.path.join(PROJECT_PATH, 'whoosh_index'), | ||
}, | ||
} |