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.

how_to_disable_an_app.rst 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. ============================
  2. How to disable an app's URLs
  3. ============================
  4. Suppose you don't want to use Oscar's dashboard but use your own. The way to do
  5. this is to modify the URLs config to exclude the URLs from the app in question.
  6. You need to use your own root 'application' instance which gives you control
  7. over the URLs structure. So your root ``urls.py`` should have::
  8. # urls.py
  9. from myproject.app import application
  10. urlpatterns = [
  11. ...
  12. url(r'', include(application.urls)),
  13. ]
  14. where ``application`` is a subclass of ``oscar.app.Shop`` which overrides the
  15. link to the dashboard app::
  16. # myproject/app.py
  17. from oscar.app import Shop
  18. from oscar.core.application import Application
  19. class MyShop(Shop):
  20. # Override the core dashboard_app instance to use a blank application
  21. # instance. This means no dashboard URLs are included.
  22. dashboard_app = Application()
  23. The only remaining task is to ensure your templates don't reference any
  24. dashboard URLs.