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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.ranges.app import application as ranges_app
  12. from oscar.apps.dashboard.reviews.app import application as reviews_app
  13. from oscar.apps.dashboard import views
  14. class DashboardApplication(Application):
  15. name = 'dashboard'
  16. index_view = views.IndexView
  17. reports_app = reports_app
  18. orders_app = orders_app
  19. users_app = users_app
  20. catalogue_app = catalogue_app
  21. promotions_app = promotions_app
  22. pages_app = pages_app
  23. offers_app = offers_app
  24. ranges_app = ranges_app
  25. reviews_app = reviews_app
  26. def get_urls(self):
  27. urlpatterns = patterns('',
  28. url(r'^$', self.index_view.as_view(), name='index'),
  29. url(r'^catalogue/', include(self.catalogue_app.urls)),
  30. url(r'^reports/', include(self.reports_app.urls)),
  31. url(r'^orders/', include(self.orders_app.urls)),
  32. url(r'^users/', include(self.users_app.urls)),
  33. url(r'^content-blocks/', include(self.promotions_app.urls)),
  34. url(r'^pages/', include(self.pages_app.urls)),
  35. url(r'^offers/', include(self.offers_app.urls)),
  36. url(r'^ranges/', include(self.ranges_app.urls)),
  37. url(r'^reviews/', include(self.reviews_app.urls)),
  38. )
  39. return self.post_process_urls(urlpatterns)
  40. def get_url_decorator(self, url_name):
  41. return staff_member_required
  42. application = DashboardApplication()