2
0

urls.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from django.urls import include, path, re_path
  2. from wagtail.contrib.sitemaps.views import sitemap
  3. from wagtail import urls as wagtailcore_urls
  4. from wagtailcrx.settings import crx_settings
  5. from wagtailcrx.views import (
  6. event_generate_ical_for_calendar,
  7. event_generate_recurring_ical_for_event,
  8. event_generate_single_ical_for_event,
  9. event_get_calendar_events,
  10. favicon,
  11. robots,
  12. serve_protected_file
  13. )
  14. urlpatterns = [
  15. # CodeRed custom URLs
  16. path(r'favicon.ico', favicon, name='codered_favicon'),
  17. path(r'robots.txt', robots, name='codered_robots'),
  18. path(r'sitemap.xml', sitemap, name='codered_sitemap'),
  19. re_path(r'^{0}(?P<path>.*)$'.format(
  20. crx_settings.CRX_PROTECTED_MEDIA_URL.lstrip('/')),
  21. serve_protected_file,
  22. name="serve_protected_file"
  23. ),
  24. # Event/Calendar URLs
  25. path('ical/generate/single/', event_generate_single_ical_for_event,
  26. name='event_generate_single_ical'),
  27. path('ical/generate/recurring/', event_generate_recurring_ical_for_event,
  28. name='event_generate_recurring_ical'),
  29. path('ical/generate/calendar/', event_generate_ical_for_calendar,
  30. name='event_generate_ical_for_calendar'),
  31. path('ajax/calendar/events/', event_get_calendar_events,
  32. name='event_get_calendar_events'),
  33. # Wagtail
  34. path('', include(wagtailcore_urls)),
  35. ]