| 123456789101112131415161718 |
- from django.contrib import admin
- from django.urls import path, include
- from django.conf import settings
- from django.conf.urls.static import static
- from django.views.static import serve
- import os
- urlpatterns = [
- path('admin/', admin.site.urls),
- path('', include('assetapp.urls')),
- path('', include('django.contrib.auth.urls')),
- ]
- # Serve static and media files (works in both DEBUG and non-DEBUG modes)
- urlpatterns += [
- path('static/<path:path>', serve, {'document_root': settings.STATIC_ROOT}),
- path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}),
- ]
|