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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. from django.conf.urls 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.offer.app import application as offer_app
  11. from oscar.apps.dashboard.app import application as dashboard_app
  12. from oscar.apps.customer import forms
  13. class Shop(Application):
  14. name = None
  15. catalogue_app = catalogue_app
  16. customer_app = customer_app
  17. basket_app = basket_app
  18. checkout_app = checkout_app
  19. promotions_app = promotions_app
  20. search_app = search_app
  21. dashboard_app = dashboard_app
  22. offer_app = offer_app
  23. def get_urls(self):
  24. urlpatterns = patterns('',
  25. (r'^catalogue/', include(self.catalogue_app.urls)),
  26. (r'^basket/', include(self.basket_app.urls)),
  27. (r'^checkout/', include(self.checkout_app.urls)),
  28. (r'^accounts/', include(self.customer_app.urls)),
  29. (r'^search/', include(self.search_app.urls)),
  30. (r'^dashboard/', include(self.dashboard_app.urls)),
  31. (r'^offers/', include(self.offer_app.urls)),
  32. # Password reset - as we're using Django's default view funtions,
  33. # we can't namespace these urls as that prevents
  34. # the reverse function from working.
  35. url(r'^password-reset/$', auth_views.password_reset,
  36. {'password_reset_form': forms.PasswordResetForm},
  37. name='password-reset'),
  38. url(r'^password-reset/done/$', auth_views.password_reset_done,
  39. name='password-reset-done'),
  40. url(r'^password-reset/confirm/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
  41. auth_views.password_reset_confirm,
  42. name='password-reset-confirm'),
  43. url(r'^password-reset/complete/$',
  44. auth_views.password_reset_complete,
  45. name='password-reset-complete'),
  46. (r'', include(self.promotions_app.urls)),
  47. )
  48. return urlpatterns
  49. # 'shop' kept for legacy projects - 'application' is a better name
  50. shop = application = Shop()