Oh sure, I’m doing that of course, but it still doesn’t work.
Here is everything I have in my code related to dashboard:
#### settings
INSTALLED_APPS = [
# stuff
'hamigdalor.apps.dashboard',
'hamigdalor.apps.staffpicks’,
# stuff
] + get_core_apps()
OSCAR_DASHBOARD_NAVIGATION += [
{
'label': 'Staff Picks',
'children': [
{
'label': 'Staff Picks',
'url_name': 'staffpick-dashboard:list',
},
]
},
]
####
hamigdalor.apps.staffpicks.dashboard.app
# stuff removed
from oscar.core.application import Application
from . import views
class StoresDashboardApplication(Application):
name = 'staffpick-dashboard'
staffpick_list_view = views.StaffPickListView
def get_urls(self):
urlpatterns = patterns('',
url(
r'^$',
self.staffpick_list_view.as_view(),
name='list'
),
)
return self.post_process_urls(urlpatterns)
def get_url_decorator(self, url_name):
return staff_member_required
application = StoresDashboardApplication()
####
hamigdalor.apps.dashboard.app
# stuff removed
from
oscar.apps.dashboard.app import DashboardApplication
from
hamigdalor.apps.staffpicks.dashboard.app import application as staffpicks_dashboard
class HaMigdalorDashboardApplication(DashboardApplication):
staffpicks_app = staffpicks_dashboard
def get_urls(self):
urls = [
url(r'^$', self.index_view.as_view(), name='index'),
url(r'^catalogue/', include(self.catalogue_app.urls)),
url(r'^reports/', include(self.reports_app.urls)),
url(r'^orders/', include(self.orders_app.urls)),
url(r'^users/', include(self.users_app.urls)),
url(r'^content-blocks/', include(self.promotions_app.urls)),
url(r'^pages/', include(self.pages_app.urls)),
url(r'^partners/', include(self.partners_app.urls)),
url(r'^offers/', include(self.offers_app.urls)),
url(r'^ranges/', include(self.ranges_app.urls)),
url(r'^reviews/', include(self.reviews_app.urls)),
url(r'^vouchers/', include(self.vouchers_app.urls)),
url(r'^comms/', include(self.comms_app.urls)),
url(r'^staffpicks/', include(self.staffpicks_app.urls)),
]
return self.post_process_urls(patterns('', *urls))
application = HaMigdalorDashboardApplication()
####
hamigdalor.app
from oscar.core.loading import get_class
from
oscar.app import Shop
class HaMigdalorShop(Shop):
search_app = get_class('
hamigdalor.apps.search.app', 'application')
dashboard_app = get_class('
hamigdalor.apps.dashboard.app', 'application')
application = HaMigdalorShop()
####hamigdalor.urls
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.conf import settings
from
hamigdalor.app import application
from
hamigdalor.apps.contributors.app import application as contributors
from
hamigdalor.apps.events.app import application as events
from
hamigdalor.apps.interviews.app import application as interviews
from
hamigdalor.apps.newsletters.app import application as newsletters
from
hamigdalor.apps.quotations.app import application as quotations
from
hamigdalor.apps.staffpicks.app import application as staffpicks
from
hamigdalor.apps.tags.app import application as tags
from
hamigdalor.apps.windows.app import application as windows
admin.autodiscover()
urlpatterns = patterns('',
url(r'^contributors/', include(contributors.urls)),
url(r'^events/', include(events.urls)),
url(r'^interviews/', include(interviews.urls)),
url(r'^newsletters/', include(newsletters.urls)),
url(r'^quotations/', include(quotations.urls)),
url(r'^staffpicks/', include(staffpicks.urls)),
url(r'^tags/', include(tags.urls)),
url(r'^window/', include(windows.urls)),
url(r'^admin/', include(admin.site.urls)),
url(r'', include(application.urls)),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
I’ve now just discovered that if I add the dashboard URLs to my main urls file (as you suggest), then I can get the added menu in the dashboard (e.g.: url(r’^staffpicks-dashboard/', include(staffpicks_dashboard.urls)),). But, why do I need to do that when I am already overriding the dashboard app and including it there?
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-oscar/53566A68.9040401%40tangentsnowball.com.