2022-08-14 14:44:17 +02:00
|
|
|
"""
|
|
|
|
urls.py
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
Note: This is not a good example how your urls.py can look like.
|
|
|
|
Because this setup is just an example without a real Python application.
|
|
|
|
|
|
|
|
Look at real examples, here:
|
|
|
|
|
|
|
|
* https://github.com/YunoHost-Apps/django-fritzconnection_ynh/blob/master/conf/urls.py
|
|
|
|
* https://github.com/YunoHost-Apps/django-for-runners_ynh/blob/testing/conf/urls.py
|
|
|
|
* https://github.com/YunoHost-Apps/pyinventory_ynh/blob/testing/conf/urls.py
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2020-12-23 19:53:13 +01:00
|
|
|
from django.conf import settings
|
|
|
|
from django.contrib import admin
|
|
|
|
from django.urls import path
|
2022-08-14 14:44:17 +02:00
|
|
|
|
2021-02-28 10:56:42 +01:00
|
|
|
from django_yunohost_integration.views import request_media_debug_view
|
2020-12-23 19:53:13 +01:00
|
|
|
|
|
|
|
|
2022-08-14 14:44:17 +02:00
|
|
|
if settings.PATH_URL:
|
|
|
|
# settings.PATH_URL is the $YNH_APP_ARG_PATH
|
|
|
|
# Prefix all urls with "PATH_URL":
|
|
|
|
urlpatterns = [
|
|
|
|
path(f'{settings.PATH_URL}/debug/', request_media_debug_view),
|
2022-08-14 19:30:06 +02:00
|
|
|
path(f'{settings.PATH_URL}/', admin.site.urls),
|
2022-08-14 14:44:17 +02:00
|
|
|
]
|
|
|
|
else:
|
|
|
|
# Installed to domain root, without a path prefix
|
|
|
|
urlpatterns = [
|
2022-08-15 08:26:42 +02:00
|
|
|
path('debug/', request_media_debug_view),
|
|
|
|
path('', admin.site.urls),
|
2022-08-14 14:44:17 +02:00
|
|
|
]
|