urls.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import django
  2. from django.conf.urls import url
  3. try:
  4. from django.views.i18n import JavaScriptCatalog
  5. javascript_catalog = JavaScriptCatalog.as_view()
  6. except ImportError: # Django < 2.0
  7. from django.views.i18n import javascript_catalog
  8. from jet.views import add_bookmark_view, remove_bookmark_view, toggle_application_pin_view, model_lookup_view
  9. app_name = 'jet'
  10. urlpatterns = [
  11. url(
  12. r'^add_bookmark/$',
  13. add_bookmark_view,
  14. name='add_bookmark'
  15. ),
  16. url(
  17. r'^remove_bookmark/$',
  18. remove_bookmark_view,
  19. name='remove_bookmark'
  20. ),
  21. url(
  22. r'^toggle_application_pin/$',
  23. toggle_application_pin_view,
  24. name='toggle_application_pin'
  25. ),
  26. url(
  27. r'^model_lookup/$',
  28. model_lookup_view,
  29. name='model_lookup'
  30. ),
  31. url(
  32. r'^jsi18n/$',
  33. javascript_catalog,
  34. {'packages': 'django.contrib.admin+jet'},
  35. name='jsi18n'
  36. ),
  37. ]
  38. if django.VERSION[:2] < (1, 8):
  39. from django.conf.urls import patterns
  40. urlpatterns = patterns('', *urlpatterns)