Skip to content

Commit

Permalink
Merge pull request #38 from Phoupraw/YDX-2147483647/issue34
Browse files Browse the repository at this point in the history
fix: No django_browser_reload in deployment
  • Loading branch information
YDX-2147483647 authored Aug 11, 2023
2 parents 3090c19 + 4ed5eb4 commit 4c264b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion contest/contest/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
from django.urls import include, path
from django_cas_ng import views as cas_views

from .settings import DEBUG

urlpatterns = [
path("", include("quiz.urls")),
path("admin/", admin.site.urls),
path("accounts/login/", cas_views.LoginView.as_view(), name="login"),
path("accounts/logout/", cas_views.LogoutView.as_view(), name="logout"),
path("__reload__/", include("django_browser_reload.urls")),
]

if DEBUG:
urlpatterns.extend(
[
path("__reload__/", include("django_browser_reload.urls")),
]
)
8 changes: 7 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ is_dev := if env_var_or_default("DJANGO_PRODUCTION", "") == "" {
"false"
}

poetry_install_additional_args := if env_var_or_default("CI", "") == "" {
""
} else {
"--sync"
}

src_dir := "contest"


Expand Down Expand Up @@ -46,7 +52,7 @@ check-deploy: && test (manage "check" "--deploy")

# 更新依赖、数据库等(拉取他人提交后建议运行)
update: && (manage "migrate")
poetry install --no-root {{ if is_dev == "false" { "--without dev" } else { "" } }}
poetry install --no-root {{ if is_dev == "false" { "--without dev" } else { "" } }} {{ poetry_install_additional_args }}
{{ if is_dev == "true" { "pnpm --dir " + src_dir + "/theme/static_src/ install" } else { "" } }}
{{ if is_dev == "true" { "pnpm --dir " + src_dir + "/js/static_src/ install" } else { "" } }}

Expand Down

0 comments on commit 4c264b1

Please sign in to comment.