diff --git a/Pipfile b/Pipfile index 19993b6b..3b428b03 100644 --- a/Pipfile +++ b/Pipfile @@ -23,7 +23,7 @@ name = "pypi" # 5. Run `pipenv install --dev` in your terminal. [packages] -codeforlife = {ref = "v0.17.1", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"} +codeforlife = {ref = "backend_template", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"} # 🚫 Don't add [packages] below that are inherited from the CFL package. pyjwt = "==2.6.0" # TODO: upgrade to latest version # TODO: Needed by RR. Remove when RR has moved to new system. @@ -32,7 +32,7 @@ django-sekizai = "==2.0.0" django-classy-tags = "==2.0.0" [dev-packages] -codeforlife = {ref = "v0.17.1", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]} +codeforlife = {ref = "backend_template", git = "https://github.com/ocadotechnology/codeforlife-package-python.git", extras = ["dev"]} # codeforlife = {file = "../codeforlife-package-python", editable = true, extras = ["dev"]} # 🚫 Don't add [dev-packages] below that are inherited from the CFL package. diff --git a/Pipfile.lock b/Pipfile.lock index 078a31b4..72d6bd91 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "18d4fd265d4b28c26bbd24b285748bacb3fbceb52dca0b57245586ebf4dd71b1" + "sha256": "e4cf42cbb4705433125db32f7246b58e9f3fd527945a457b57f0d07b7277bf1e" }, "pipfile-spec": 6, "requires": { @@ -160,7 +160,7 @@ }, "codeforlife": { "git": "https://github.com/ocadotechnology/codeforlife-package-python.git", - "ref": "940c41a2998d45d2629e34e7792736f521ffe0a8" + "ref": "bd0c488e6c8522d52d547fec609b01eddf0528e5" }, "codeforlife-portal": { "hashes": [ @@ -529,10 +529,10 @@ }, "openpyxl": { "hashes": [ - "sha256:8d2c8adf5d20d6ce8f9bca381df86b534835e974ed0156dacefa76f68c1d69fb", - "sha256:ec17f6483f2b8f7c88c57e5e5d3b0de0e3fb9ac70edc084d28e864f5b33bbefd" + "sha256:5282c12b107bffeef825f4617dc029afaf41d0ea60823bbb665ef3079dc79de2", + "sha256:cf0e3cf56142039133628b5acffe8ef0c12bc902d2aadd3e0fe5878dc08d1050" ], - "version": "==3.1.4" + "version": "==3.1.5" }, "pandas": { "hashes": [ @@ -1133,7 +1133,7 @@ }, "codeforlife": { "git": "https://github.com/ocadotechnology/codeforlife-package-python.git", - "ref": "940c41a2998d45d2629e34e7792736f521ffe0a8" + "ref": "bd0c488e6c8522d52d547fec609b01eddf0528e5" }, "codeforlife-portal": { "hashes": [ @@ -1684,10 +1684,10 @@ }, "openpyxl": { "hashes": [ - "sha256:8d2c8adf5d20d6ce8f9bca381df86b534835e974ed0156dacefa76f68c1d69fb", - "sha256:ec17f6483f2b8f7c88c57e5e5d3b0de0e3fb9ac70edc084d28e864f5b33bbefd" + "sha256:5282c12b107bffeef825f4617dc029afaf41d0ea60823bbb665ef3079dc79de2", + "sha256:cf0e3cf56142039133628b5acffe8ef0c12bc902d2aadd3e0fe5878dc08d1050" ], - "version": "==3.1.4" + "version": "==3.1.5" }, "packaging": { "hashes": [ diff --git a/settings.py b/settings.py index 3c7c154d..f2b32156 100644 --- a/settings.py +++ b/settings.py @@ -60,32 +60,9 @@ """RAPID ROUTER SETTINGS""" # TODO: The settings in this section are needed for the old Rapid Router # package. Remove once RR has moved to the new system. -TEMPLATES = [ - { - "BACKEND": "django.template.backends.django.DjangoTemplates", - "APP_DIRS": True, - "OPTIONS": { - "context_processors": [ - "django.contrib.auth.context_processors.auth", - "django.template.context_processors.request", - "django.contrib.messages.context_processors.messages", - "sekizai.context_processors.sekizai", - # TODO: replace in new system and remove here - # "common.context_processors.module_name", - # "common.context_processors.cookie_management_enabled", - # TODO: use when integrating dotmailer - # "portal.context_processors.process_newsletter_form", - ] - }, - } -] - MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage" EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" -STATIC_URL = "/static/" -STATIC_ROOT = os.path.join(BASE_DIR, "static") - PIPELINE_ENABLED = False # True if assets should be compressed, False if not. PIPELINE = {} @@ -262,6 +239,8 @@ def domain(): from codeforlife.settings import * DATABASES = get_databases(BASE_DIR) +ROOT_URLCONF = "src.urls" +STATIC_ROOT = get_static_root(BASE_DIR) # TODO: Go through the commented out middleware and decide if we still need them MIDDLEWARE = [ @@ -277,30 +256,43 @@ def domain(): ] INSTALLED_APPS = [ + "src.api", "src.sso", "src.rapid_router", - "aimmo", - "game", "pipeline", - "portal", "captcha", - "common", - "django.contrib.admin", - "django.contrib.admindocs", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.sites", - "django.contrib.staticfiles", "import_export", "sekizai", # for javascript and css management "treebeard", *INSTALLED_APPS, ] +INSTALLED_APPS.remove("api") # Frontend pages. PAGE_TEACHER_LOGIN = f"{SERVICE_SITE_URL}/login/teacher" PAGE_INDY_LOGIN = f"{SERVICE_SITE_URL}/login/independent" PAGE_TEACHER_DASHBOARD_SCHOOL = f"{SERVICE_SITE_URL}/teacher/dashboard/school" PAGE_REGISTER = f"{SERVICE_SITE_URL}/register" + +"""RAPID ROUTER SETTINGS""" +# TODO: The settings in this section are needed for the old Rapid Router +# package. Remove once RR has moved to the new system. +TEMPLATES = [ + { + "BACKEND": "django.template.backends.django.DjangoTemplates", + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.contrib.auth.context_processors.auth", + "django.template.context_processors.request", + "django.contrib.messages.context_processors.messages", + "sekizai.context_processors.sekizai", + # TODO: replace in new system and remove here + # "common.context_processors.module_name", + # "common.context_processors.cookie_management_enabled", + # TODO: use when integrating dotmailer + # "portal.context_processors.process_newsletter_form", + ] + }, + } +] diff --git a/src/urls.py b/src/urls.py index d6797201..80655674 100644 --- a/src/urls.py +++ b/src/urls.py @@ -22,6 +22,8 @@ TeacherAimmoDashboard, ) +from .api.urls import urlpatterns + urlpatterns = [ path( "rapidrouter/", @@ -43,7 +45,7 @@ include(aimmo_urls), name="kurono", ), - *get_urlpatterns(include_user_urls=False), + *get_urlpatterns(urlpatterns, include_user_urls=False), path( "api/sso/", include("src.sso.urls"),