2
0

urls.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from django.conf import settings
  2. from django.urls import include, path
  3. from django.contrib import admin
  4. from wagtail.documents import urls as wagtaildocs_urls
  5. from wagtailcrx import admin_urls as coderedadmin_urls
  6. from wagtailcrx import search_urls as coderedsearch_urls
  7. from wagtailcrx import urls as codered_urls
  8. urlpatterns = [
  9. # Admin
  10. path('django-admin/', admin.site.urls),
  11. path('admin/', include(coderedadmin_urls)),
  12. # Documents
  13. path('docs/', include(wagtaildocs_urls)),
  14. # Search
  15. path('search/', include(coderedsearch_urls)),
  16. # For anything not caught by a more specific rule above, hand over to
  17. # the page serving mechanism. This should be the last pattern in
  18. # the list:
  19. path('', include(codered_urls)),
  20. # Alternatively, if you want CMS pages to be served from a subpath
  21. # of your site, rather than the site root:
  22. # path("pages/", include(codered_urls)),
  23. ]
  24. if settings.DEBUG:
  25. from django.conf.urls.static import static
  26. from django.contrib.staticfiles.urls import staticfiles_urlpatterns
  27. # Serve static and media files from development server
  28. urlpatterns += staticfiles_urlpatterns()
  29. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)