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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from django.conf.urls.defaults import patterns, url, include
  2. from django.contrib.auth import views as auth_views
  3. from oscar.core.application import Application
  4. from oscar.apps.catalogue.app import application as catalogue_app
  5. from oscar.apps.customer.app import application as customer_app
  6. from oscar.apps.basket.app import application as basket_app
  7. from oscar.apps.checkout.app import application as checkout_app
  8. from oscar.apps.promotions.app import application as promotions_app
  9. from oscar.apps.search.app import application as search_app
  10. from oscar.apps.dashboard.app import application as dashboard_app
  11. class Shop(Application):
  12. name = None
  13. catalogue_app = catalogue_app
  14. customer_app = customer_app
  15. basket_app = basket_app
  16. checkout_app = checkout_app
  17. promotions_app = promotions_app
  18. search_app = search_app
  19. dashboard_app = dashboard_app
  20. def get_urls(self):
  21. urlpatterns = patterns('',
  22. (r'^products/', include(self.catalogue_app.urls)),
  23. (r'^basket/', include(self.basket_app.urls)),
  24. (r'^checkout/', include(self.checkout_app.urls)),
  25. (r'^accounts/', include(self.customer_app.urls)),
  26. (r'^search/', include(self.search_app.urls)),
  27. (r'^dashboard/', include(self.dashboard_app.urls)),
  28. # Password reset - as we're using Django's default view funtions, we
  29. # can't namespace these urls as that prevents the reverse function
  30. # from working.
  31. url(r'^password-reset/$', auth_views.password_reset, name='password-reset'),
  32. url(r'^password-reset/done/$', auth_views.password_reset_done, name='password-reset-done'),
  33. url(r'^password-reset/confirm/$', auth_views.password_reset_confirm, name='password-reset-confirm'),
  34. url(r'^password-reset/complete/$', auth_views.password_reset_complete, name='password-reset-complete'),
  35. (r'', include(self.promotions_app.urls)),
  36. )
  37. return urlpatterns
  38. shop = Shop()