-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor topic_tools to use app-based settings and remove unused ASSE… #4095
Merged
benjaoming
merged 19 commits into
learningequality:0.14.x
from
benjaoming:eliminate-derived-settings
Jul 16, 2015
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f6e11d9
Refactor topic_tools to use app-based settings and remove unused ASSE…
benjaoming 6106ed4
Remove unused image in wrong location
benjaoming fb34c9f
Do not load factored out settings module legacy.topic_tools_settings
benjaoming b4aa0d6
Fix relocation of DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP
benjaoming 222333a
skip test that requires kaa
benjaoming 2f37d2c
Force location of settings specified assessment items db and version …
benjaoming 642576f
remove redundant ensure_dirs
benjaoming b488e1c
Refactor assessment item paths to respect CONTENT_ROOT
benjaoming b2ee34a
make system-wide data directory layout more similar to user data
benjaoming c88bec6
Merge branch '0.14.x' of github.com:learningequality/ka-lite into 0.14.x
benjaoming 151542c
Merge branch '0.14.x' into eliminate-derived-settings
benjaoming 4f31062
add missing line break
benjaoming ca0cfab
improve error message if ka-lite is already installed
benjaoming c9b1655
Use kalite.project.settings.default BY DEFAULT
benjaoming 55e2bdd
Acknowledge that DATABASES['assessment_items'] is derived from CONTEN…
benjaoming c31ad4a
Add sensitivity of system-wide assessment items database and amend th…
benjaoming 1b3994b
Serve assessment items static media from /khan as current templates e…
benjaoming e87e459
KHAN_ASSESSMENT_ITEM_ROOT should be respected for user data, too
benjaoming 2dc7294
Serve assessment items with cherrypy
benjaoming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 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 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 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,45 @@ | ||
""" | ||
|
||
New settings pattern | ||
|
||
See: | ||
https://github.com/learningequality/ka-lite/issues/4054 | ||
https://github.com/learningequality/ka-lite/issues/3757 | ||
|
||
All settings for the topic_tools app should be defined here, they can | ||
only on django.conf.settings | ||
""" | ||
import os | ||
from django.conf import settings | ||
|
||
from kalite import ROOT_DATA_PATH | ||
|
||
# OUTDATED - Special setting for Khan Academy content, was only used for | ||
# assessment item unpacking. All assessment items have been moved from this | ||
# location in distributed.management.commands.setup | ||
OLD_ASSESSMENT_ITEMS_LOCATION = os.path.join(settings.CONTENT_ROOT, "khan") | ||
|
||
|
||
# Are assessment items distributed in the system-wide data directory? | ||
if settings.ASSESSMENT_ITEMS_SYSTEM_WIDE: | ||
ASSESSMENT_ITEM_ROOT = os.path.join(ROOT_DATA_PATH, 'assessment') | ||
KHAN_ASSESSMENT_ITEM_ROOT = os.path.join(ASSESSMENT_ITEM_ROOT, 'khan') | ||
else: | ||
# Where assessment items are stored in general (but no additional channels | ||
# exist yet so it's all hard-coded for KHAN_ASSESSMENT_ITEM_ROOT below) | ||
ASSESSMENT_ITEM_ROOT = os.path.join(settings.CONTENT_ROOT, 'assessment') | ||
|
||
if not os.path.exists(ASSESSMENT_ITEM_ROOT): | ||
os.mkdir(ASSESSMENT_ITEM_ROOT) | ||
|
||
KHAN_ASSESSMENT_ITEM_ROOT = os.path.join(ASSESSMENT_ITEM_ROOT, 'khan') | ||
if not os.path.exists(KHAN_ASSESSMENT_ITEM_ROOT): | ||
os.mkdir(KHAN_ASSESSMENT_ITEM_ROOT) | ||
|
||
# This one should always the settings because it is part of settings.DATABASES | ||
KHAN_ASSESSMENT_ITEM_DATABASE_PATH = settings.DATABASES['assessment_items']['NAME'] | ||
|
||
# Default locations of specific elements from the assessment items bundle. | ||
# Files will be forced into this location when running unpack_assessment_zip | ||
KHAN_ASSESSMENT_ITEM_VERSION_PATH = os.path.join(KHAN_ASSESSMENT_ITEM_ROOT, 'assessmentitems.version') | ||
KHAN_ASSESSMENT_ITEM_JSON_PATH = os.path.join(KHAN_ASSESSMENT_ITEM_ROOT, 'assessmentitems.json') |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.