You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.py 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. from django.conf.urls import patterns, url, include
  2. from oscar.views.decorators import staff_member_required
  3. from oscar.core.application import Application
  4. from oscar.apps.dashboard.reports.app import application as reports_app
  5. from oscar.apps.dashboard.orders.app import application as orders_app
  6. from oscar.apps.dashboard.users.app import application as users_app
  7. from oscar.apps.dashboard.promotions.app import application as promotions_app
  8. from oscar.apps.dashboard.catalogue.app import application as catalogue_app
  9. from oscar.apps.dashboard.pages.app import application as pages_app
  10. from oscar.apps.dashboard.offers.app import application as offers_app
  11. from oscar.apps.dashboard.ranges.app import application as ranges_app
  12. from oscar.apps.dashboard.reviews.app import application as reviews_app
  13. from oscar.apps.dashboard.vouchers.app import application as vouchers_app
  14. from oscar.apps.dashboard.communications.app import application as comms_app
  15. from oscar.apps.dashboard import views
  16. class DashboardApplication(Application):
  17. name = 'dashboard'
  18. index_view = views.IndexView
  19. reports_app = reports_app
  20. orders_app = orders_app
  21. users_app = users_app
  22. catalogue_app = catalogue_app
  23. promotions_app = promotions_app
  24. pages_app = pages_app
  25. offers_app = offers_app
  26. ranges_app = ranges_app
  27. reviews_app = reviews_app
  28. vouchers_app = vouchers_app
  29. comms_app = comms_app
  30. def get_urls(self):
  31. urlpatterns = patterns('',
  32. url(r'^$', self.index_view.as_view(), name='index'),
  33. url(r'^catalogue/', include(self.catalogue_app.urls)),
  34. url(r'^reports/', include(self.reports_app.urls)),
  35. url(r'^orders/', include(self.orders_app.urls)),
  36. url(r'^users/', include(self.users_app.urls)),
  37. url(r'^content-blocks/', include(self.promotions_app.urls)),
  38. url(r'^pages/', include(self.pages_app.urls)),
  39. url(r'^offers/', include(self.offers_app.urls)),
  40. url(r'^ranges/', include(self.ranges_app.urls)),
  41. url(r'^reviews/', include(self.reviews_app.urls)),
  42. url(r'^vouchers/', include(self.vouchers_app.urls)),
  43. url(r'^comms/', include(self.comms_app.urls)),
  44. )
  45. return self.post_process_urls(urlpatterns)
  46. def get_url_decorator(self, url_name):
  47. return staff_member_required
  48. application = DashboardApplication()