Skip to content

Commit

Permalink
new py package
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Jul 2, 2024
1 parent defc440 commit 695642f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 47 deletions.
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

Expand Down
18 changes: 9 additions & 9 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 27 additions & 35 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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 = [
Expand All @@ -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",
]
},
}
]
4 changes: 3 additions & 1 deletion src/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
TeacherAimmoDashboard,
)

from .api.urls import urlpatterns

urlpatterns = [
path(
"rapidrouter/",
Expand All @@ -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"),
Expand Down

0 comments on commit 695642f

Please sign in to comment.