Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
58a46b8b
Commit
58a46b8b
authored
Jul 16, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactore testproject.settings to accommodate more scenarios
parent
a4e3ebfb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
23 deletions
+60
-23
testproject/README.md
+12
-0
testproject/testproject/search_sites.py
+0
-2
testproject/testproject/settings/__init__.py
+10
-21
testproject/testproject/settings/customauthuser.py
+17
-0
testproject/testproject/settings/haystack.py
+21
-0
No files found.
testproject/README.md
View file @
58a46b8b
...
...
@@ -6,6 +6,9 @@ that you have checked out the root of the Git repository.
It comes with a prepopulated SQLite database.
Test settings
-------------
Setup
-----
...
...
@@ -14,6 +17,15 @@ You should link your wiki and django_notify folders like so
ln -s ../wiki .
ln -s ../django_notify .
Running
-------
You should be able to immediately run it like this:
python manage.py runserver --settings=testproject.settings.local
The settings come in a package to administer several test scenarios. For simple purposes, simply edit
`local.py`
.
Login
-----
...
...
testproject/testproject/search_sites.py
deleted
100644 → 0
View file @
a4e3ebfb
import
haystack
haystack
.
autodiscover
()
testproject/testproject/settings.py
→
testproject/testproject/settings
/__init__
.py
View file @
58a46b8b
# -*- 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 @@ ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
#from django.core.urlresolvers import reverse_lazy
#LOGIN_REDIRECT_URL = reverse_lazy('wiki:get', kwargs={'path': ''})
MANAGERS
=
ADMINS
DATABASES
=
{
...
...
@@ -21,12 +18,6 @@ DATABASES = {
}
}
#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,15 +43,13 @@ STATICFILES_FINDERS = (
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
SECRET_KEY
=
'b^fv_)t39h
%9
p40)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'
,
...
...
@@ -68,7 +57,7 @@ MIDDLEWARE_CLASSES = (
'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 @@ TEMPLATE_DIRS = (
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 @@ TEMPLATE_CONTEXT_PROCESSORS =(
'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 @@ INSTALLED_APPS = (
'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_WRITE = True
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
...
...
testproject/testproject/settings/customauthuser.py
0 → 100644
View file @
58a46b8b
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'
\ No newline at end of file
testproject/testproject/settings/haystack.py
0 → 100644
View file @
58a46b8b
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'
),
},
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment