Parcourir la source

Update of django app base url use

Jérôme BUISINE il y a 4 ans
Parent
commit
b89e88675f
2 fichiers modifiés avec 5 ajouts et 16 suppressions
  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 %}