1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00

Merge pull request #35 from YunoHost-Apps/root-url

Remove /admin/ from URLs
This commit is contained in:
Jens Diemer 2020-12-22 17:42:53 +01:00 committed by GitHub
commit d93f3790da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@ from django.conf import settings
from django.conf.urls import include, static from django.conf.urls import include, static
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from django.views.generic import RedirectView
# def debug_view(request): # def debug_view(request):
@ -18,14 +17,12 @@ from django.views.generic import RedirectView
# return HttpResponse(html) # return HttpResponse(html)
# settings.PATH_URL is the $YNH_APP_ARG_PATH
if settings.PATH_URL: if settings.PATH_URL:
# settings.PATH_URL is the $YNH_APP_ARG_PATH
# Prefix all urls with "PATH_URL": # Prefix all urls with "PATH_URL":
urlpatterns = [ urlpatterns = [
path(f'{settings.PATH_URL}/admin/', admin.site.urls), # path(f'{settings.PATH_URL}/debug/', debug_view),
path(f'{settings.PATH_URL}/', admin.site.urls),
# path(f'{settings.PATH_URL}/', debug_view),
path(f'{settings.PATH_URL}/', RedirectView.as_view(pattern_name='admin:index')),
path(f'{settings.PATH_URL}/ckeditor/', include('ckeditor_uploader.urls')), path(f'{settings.PATH_URL}/ckeditor/', include('ckeditor_uploader.urls')),