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 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from django.conf.urls.defaults import patterns, url, include
  2. from django.contrib.admin.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 import views
  12. class DashboardApplication(Application):
  13. name = 'dashboard'
  14. index_view = views.IndexView
  15. reports_app = reports_app
  16. orders_app = orders_app
  17. users_app = users_app
  18. catalogue_app = catalogue_app
  19. promotions_app = promotions_app
  20. pages_app = pages_app
  21. offers_app = offers_app
  22. def get_urls(self):
  23. urlpatterns = patterns('',
  24. url(r'^$', self.index_view.as_view(), name='index'),
  25. url(r'^catalogue/', include(self.catalogue_app.urls)),
  26. url(r'^reports/', include(self.reports_app.urls)),
  27. url(r'^orders/', include(self.orders_app.urls)),
  28. url(r'^users/', include(self.users_app.urls)),
  29. url(r'^promotions/', include(self.promotions_app.urls)),
  30. url(r'^pages/', include(self.pages_app.urls)),
  31. url(r'^offers/', include(self.offers_app.urls)),
  32. )
  33. return self.post_process_urls(urlpatterns)
  34. def get_url_decorator(self, url_name):
  35. return staff_member_required
  36. application = DashboardApplication()