Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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