def ready(self): super().ready() from auth_backends.urls import oauth2_urlpatterns from ecommerce.core.views import LogoutView # Note: Add ecommerce's logout override first to ensure it is registered by Django as the # actual logout view. Ecommerce's logout implementation supports different site configuration. self.AUTH_URLS = [url(r'^logout/$', LogoutView.as_view(), name='logout'), ] + oauth2_urlpatterns self.index_view = get_class('dashboard.views', 'ExtendedIndexView') self.refunds_app = apps.get_app_config('refunds_dashboard')
This minimally invasive approach allows us to protect Oscar's front-end without sacrificing any internal functionality. Users not authorized to view Oscar's front-end are redirected to the LMS student dashboard, as one would usually be after signing into the LMS. """ return redirect(get_lms_dashboard_url()) admin.autodiscover() admin.site.site_header = _('E-Commerce Service Administration') admin.site.site_title = admin.site.site_header # NOTE 1: Add our logout override first to ensure it is registered by Django as the actual logout view. # NOTE 2: These same patterns are used for rest_framework's browseable API authentication links. AUTH_URLS = [ url(r'^logout/$', LogoutView.as_view(), name='logout'), ] + oauth2_urlpatterns WELL_KNOWN_URLS = [ url(r'^.well-known/apple-developer-merchantid-domain-association.txt$', ApplePayMerchantDomainAssociationView.as_view(), name='apple_pay_domain_association'), ] urlpatterns = AUTH_URLS + WELL_KNOWN_URLS + [ url(r'^admin/', admin.site.urls), url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'), url(r'^api-auth/', include((AUTH_URLS, 'rest_framework'))), url(r'^api-docs/', get_swagger_view(title='Ecommerce API'), name='api_docs'),
from __future__ import absolute_import from auth_backends.urls import oauth2_urlpatterns from django.conf.urls import include, url from oscar.apps.dashboard import app from oscar.core.loading import get_class from ecommerce.core.views import LogoutView # Note: Add ecommerce's logout override first to ensure it is registered by Django as the # actual logout view. Ecommerce's logout implementation supports different site configuration. AUTH_URLS = [url(r'^logout/$', LogoutView.as_view(), name='logout'), ] + oauth2_urlpatterns class DashboardApplication(app.DashboardApplication): index_view = get_class('dashboard.views', 'ExtendedIndexView') refunds_app = get_class('dashboard.refunds.app', 'application') 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)),
without sacrificing any internal functionality. Users not authorized to view Oscar's front-end are redirected to the LMS student dashboard, as one would usually be after signing into the LMS. """ return redirect(get_lms_dashboard_url()) admin.autodiscover() js_info_dict = { 'packages': ('courses',), } # Use the same auth views for all logins, including those originating from the browseable API. AUTH_URLS = auth_urlpatterns + [ url(r'^logout/$', LogoutView.as_view(), name='logout'), ] urlpatterns = [ url('', include(AUTH_URLS)), url(r'^admin/', include(admin.site.urls)), url(r'^auto_auth/$', core_views.AutoAuth.as_view(), name='auto_auth'), url(r'^openedx_subscription/$', core_views.OpenedxSubscription.as_view(), name='openedx_subscription'), url(r'^api-auth/', include(AUTH_URLS, namespace='rest_framework')), url(r'^api-docs/', include('rest_framework_swagger.urls')), url(r'^courses/', include('ecommerce.courses.urls', namespace='courses')), url(r'^credit/', include('ecommerce.credit.urls', namespace='credit')), url(r'^coupons/', include('ecommerce.coupons.urls', namespace='coupons')), url(r'^health/$', core_views.health, name='health'), url(r'^i18n/', include('django.conf.urls.i18n')),