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.2KB

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