urls.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. from django.conf import settings
  2. from django.urls import include, path, re_path
  3. from django.contrib import admin
  4. from wagtail.documents import urls as wagtaildocs_urls
  5. from coderedcms import admin_urls as crx_admin_urls
  6. from coderedcms import search_urls as crx_search_urls
  7. from coderedcms import urls as crx_urls
  8. urlpatterns = [
  9. # Admin
  10. path("django-admin/", admin.site.urls),
  11. path("admin/", include(crx_admin_urls)),
  12. # Documents
  13. path("docs/", include(wagtaildocs_urls)),
  14. # Search
  15. path("search/", include(crx_search_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. re_path(r"", include(crx_urls)),
  20. # Alternatively, if you want pages to be served from a subpath
  21. # of your site, rather than the site root:
  22. # re_path(r"^pages/", include(crx_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)