-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from learningequality/settings
Use Kolibri plugin built in settings and options augmentation.
- Loading branch information
Showing
4 changed files
with
20 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
option_defaults = { | ||
"Deployment": { | ||
"LANGUAGES": ["en", "sw-tz", "fr-fr", "pt-br"], | ||
} | ||
} |
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,44 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from kolibri_instant_schools_plugin.instant_schools_settings import * # noqa | ||
from kolibri.deployment.default.settings.dev import * # noqa | ||
|
||
# copied from kolibri.deployment.settings.dev | ||
DEBUG = True | ||
|
||
# Settings might be tuples, so switch to lists | ||
INSTALLED_APPS = list(INSTALLED_APPS) + ["drf_yasg"] # noqa F405 | ||
webpack_middleware = "kolibri.core.webpack.middleware.WebpackErrorHandler" | ||
no_login_popup_middleware = ( | ||
"kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware" | ||
) | ||
MIDDLEWARE = list(MIDDLEWARE) + [ # noqa F405 | ||
webpack_middleware, | ||
no_login_popup_middleware, | ||
] | ||
|
||
INTERNAL_IPS = ["127.0.0.1"] | ||
|
||
ROOT_URLCONF = "kolibri.deployment.default.dev_urls" | ||
|
||
DEVELOPER_MODE = True | ||
os.environ.update({"KOLIBRI_DEVELOPER_MODE": "True"}) | ||
|
||
|
||
REST_FRAMEWORK = { | ||
"UNAUTHENTICATED_USER": "kolibri.core.auth.models.KolibriAnonymousUser", | ||
"DEFAULT_AUTHENTICATION_CLASSES": [ | ||
# Always keep this first, so that we consistently return 403 responses | ||
# when a request is unauthenticated. | ||
"rest_framework.authentication.SessionAuthentication", | ||
# Activate basic auth for external API testing tools | ||
"rest_framework.authentication.BasicAuthentication", | ||
], | ||
"DEFAULT_RENDERER_CLASSES": ( | ||
"rest_framework.renderers.JSONRenderer", | ||
"rest_framework.renderers.BrowsableAPIRenderer", | ||
), | ||
"EXCEPTION_HANDLER": "kolibri.core.utils.exception_handler.custom_exception_handler", | ||
} | ||
|
||
SWAGGER_SETTINGS = {"DEFAULT_INFO": "kolibri.deployment.default.dev_urls.api_info"} | ||
USE_X_FORWARDED_HOST = False | ||
USE_X_FORWARDED_PORT = False | ||
CSRF_COOKIE_SECURE = False | ||
SESSION_COOKIE_SECURE = False | ||
ALLOW_CERTIFICATE_PUSHING = False |
29 changes: 7 additions & 22 deletions
29
kolibri_instant_schools_plugin/instant_schools_settings.py
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,25 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from kolibri.deployment.default.settings.base import * | ||
INSTALLED_APPS = ["django.contrib.admin"] | ||
|
||
INSTALLED_APPS = list(INSTALLED_APPS) + ["django.contrib.admin"] | ||
|
||
OLD_DB_PATH = os.path.join(conf.KOLIBRI_HOME, 'db.sqlite3') | ||
OLD_HASH_DB_PATH = os.path.join(conf.KOLIBRI_HOME, 'phonehashreverselookup.db') | ||
|
||
DATABASES["default"]["NAME"] = os.path.join(conf.KOLIBRI_HOME, 'instant_schools_primary.sqlite3') | ||
|
||
LANGUAGES = [ | ||
('en', 'English'), | ||
('sw-tz', 'Kiswahili'), | ||
('fr-fr', 'Français'), | ||
('pt-br', 'Português'), | ||
] | ||
|
||
USE_X_FORWARDED_HOST = (not DEBUG) | ||
USE_X_FORWARDED_PORT = (not DEBUG) | ||
CSRF_COOKIE_SECURE = (not DEBUG) | ||
SESSION_COOKIE_SECURE = (not DEBUG) | ||
ALLOW_CERTIFICATE_PUSHING = (not DEBUG) | ||
USE_X_FORWARDED_HOST = True | ||
USE_X_FORWARDED_PORT = True | ||
CSRF_COOKIE_SECURE = True | ||
SESSION_COOKIE_SECURE = True | ||
ALLOW_CERTIFICATE_PUSHING = True | ||
SECURE_FRAME_DENY = False | ||
X_FRAME_OPTIONS = "SAMEORIGIN" | ||
X_FRAME_OPTIONS = "SAMEORIGIN" |
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