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.

urls.py 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. from django.conf.urls import patterns, include, url
  2. from django.conf import settings
  3. from django.contrib import admin
  4. from django.conf.urls.static import static
  5. from oscar.app import shop
  6. # These simply need to be imported into this namespace. Ignore the PEP8
  7. # warning that they aren't used.
  8. from oscar.views import handler500, handler404, handler403
  9. admin.autodiscover()
  10. urlpatterns = patterns('',
  11. # Include admin as convenience. It's unsupported and you should
  12. # use the dashboard
  13. (r'^admin/', include(admin.site.urls)),
  14. # Custom functionality to allow dashboard users to be created
  15. (r'^gateway/', include('apps.gateway.urls')),
  16. (r'', include(shop.urls)),
  17. )
  18. # Allow rosetta to be used to add translations
  19. if 'rosetta' in settings.INSTALLED_APPS:
  20. urlpatterns += patterns('',
  21. (r'^rosetta/', include('rosetta.urls')),
  22. )
  23. if settings.DEBUG:
  24. # Server statics and uploaded media
  25. urlpatterns += static(settings.MEDIA_URL,
  26. document_root=settings.MEDIA_ROOT)
  27. # Allow error pages to be tested
  28. urlpatterns += patterns('',
  29. url(r'^403$', handler403),
  30. url(r'^404$', handler404),
  31. url(r'^500$', handler500)
  32. )