浏览代码

Update of django app base url use

Jérôme BUISINE 4 年之前
父节点
当前提交
b89e88675f
共有 2 个文件被更改,包括 5 次插入16 次删除
  1. 4 14
      ThesisWebExpeDjango/urls.py
  2. 1 2
      expe/templates/base.html

+ 4 - 14
ThesisWebExpeDjango/urls.py

@@ -17,17 +17,7 @@ from django.contrib import admin
 from django.urls import include, path
 from django.views.generic import RedirectView
 
-from .settings import WEBEXPE_PREFIX_URL
-
-
-if WEBEXPE_PREFIX_URL == '':
-    urlpatterns = [
-        path('', include('expe.urls', namespace='expe')),
-        path('admin/', admin.site.urls),
-    ]
-else:
-    urlpatterns = [
-        path('', RedirectView.as_view(url=WEBEXPE_PREFIX_URL)),
-        path(WEBEXPE_PREFIX_URL + '/', include('expe.urls', namespace='expe')),
-        path(WEBEXPE_PREFIX_URL + '/admin/', admin.site.urls),
-    ]
+urlpatterns = [
+    path('', include('expe.urls', namespace='expe')),
+    path('admin/', admin.site.urls),
+]

+ 1 - 2
expe/templates/base.html

@@ -29,14 +29,13 @@
         // add by default '/' into BASE
         const BASE     = "{{BASE}}"
         const host     = window.location.host
-        var baseUrl  = location.protocol + '//' + host + '/'
+        var baseUrl    = location.protocol + '//' + host + '/'
 
         if (BASE != ''){
             baseUrl += BASE + '/'
         }
 
         const expeUrl  = baseUrl + 'expe'     
-        console.log(expeUrl)
     </script>
     {% block javascripts %}