urls.py 593 B

123456789101112131415161718
  1. from django.contrib import admin
  2. from django.urls import path, include
  3. from django.conf import settings
  4. from django.conf.urls.static import static
  5. from django.views.static import serve
  6. import os
  7. urlpatterns = [
  8. path('admin/', admin.site.urls),
  9. path('', include('assetapp.urls')),
  10. path('', include('django.contrib.auth.urls')),
  11. ]
  12. # Serve static and media files (works in both DEBUG and non-DEBUG modes)
  13. urlpatterns += [
  14. path('static/<path:path>', serve, {'document_root': settings.STATIC_ROOT}),
  15. path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}),
  16. ]