"""
URL configuration for wilco Django example project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/6.0/topics/http/urls/
"""

from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.static import serve

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", include("wilco.bridges.django.urls")),
    path("", include("apps.store.urls")),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
else:
    # In example prod mode, serve media directly (a real deployment would use nginx/CDN)
    urlpatterns.append(path("media/<path:path>", serve, {"document_root": settings.MEDIA_ROOT}))
