浏览代码

Update urls.py

Nick Sweeting 2 年之前
父节点
当前提交
480eff52db
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      archivebox/core/urls.py

+ 3 - 1
archivebox/core/urls.py

@@ -12,6 +12,8 @@ from config import VERSION, VERSION_RELEASES, CAN_UPGRADE
 
 
 # print('DEBUG', settings.DEBUG)
 # print('DEBUG', settings.DEBUG)
 
 
+GLOBAL_CONTEXT = {'VERSION': VERSION, 'VERSIONS_AVAILABLE': VERSIONS_AVAILABLE, 'CAN_UPGRADE': CAN_UPGRADE}
+
 urlpatterns = [
 urlpatterns = [
     path('public/', PublicIndexView.as_view(), name='public-index'),
     path('public/', PublicIndexView.as_view(), name='public-index'),
 
 
@@ -31,7 +33,7 @@ urlpatterns = [
 
 
 
 
     path('accounts/', include('django.contrib.auth.urls')),
     path('accounts/', include('django.contrib.auth.urls')),
-    path('admin/', admin.site.urls, {'extra_context': {'VERSION': VERSION, 'VERSION_RELEASES': VERSION_RELEASES, 'CAN_UPGRADE': CAN_UPGRADE}}),
+    path('admin/', admin.site.urls, {'extra_context': GLOBAL_CONTEXT}),
 
 
     path('health/', HealthCheckView.as_view(), name='healthcheck'),
     path('health/', HealthCheckView.as_view(), name='healthcheck'),
     path('error/', lambda _: 1/0),
     path('error/', lambda _: 1/0),