urls.py 1.0 KB

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