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