Django Oscar - Alernative Oscar Setup - Part 15

 

from .oscar import * # By the end of settings.py

 

from django.conf import settings 
from oscar.defaults import *



settings.INSTALLED_APPS += [

    'django.contrib.sites',
    'django.contrib.flatpages',

    'oscar.config.Shop',
    'oscar.apps.analytics.apps.AnalyticsConfig',
    'oscar.apps.checkout.apps.CheckoutConfig',
    'oscar.apps.address.apps.AddressConfig',
    # 'oscar.apps.shipping.apps.ShippingConfig',
    'myShipping.shipping.apps.ShippingConfig',
    'oscar.apps.catalogue.apps.CatalogueConfig',
    'oscar.apps.catalogue.reviews.apps.CatalogueReviewsConfig',
    'oscar.apps.communication.apps.CommunicationConfig',
    'oscar.apps.partner.apps.PartnerConfig',
    'oscar.apps.basket.apps.BasketConfig',
    'oscar.apps.payment.apps.PaymentConfig',
    'oscar.apps.offer.apps.OfferConfig',
    'oscar.apps.order.apps.OrderConfig',
    'oscar.apps.customer.apps.CustomerConfig',
    'oscar.apps.search.apps.SearchConfig',
    'oscar.apps.voucher.apps.VoucherConfig',
    'oscar.apps.wishlists.apps.WishlistsConfig',
    'oscar.apps.dashboard.apps.DashboardConfig',
    'oscar.apps.dashboard.reports.apps.ReportsDashboardConfig',
    'oscar.apps.dashboard.users.apps.UsersDashboardConfig',
    'oscar.apps.dashboard.orders.apps.OrdersDashboardConfig',
    'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',
    'oscar.apps.dashboard.offers.apps.OffersDashboardConfig',
    'oscar.apps.dashboard.partners.apps.PartnersDashboardConfig',
    'oscar.apps.dashboard.pages.apps.PagesDashboardConfig',
    'oscar.apps.dashboard.ranges.apps.RangesDashboardConfig',
    'oscar.apps.dashboard.reviews.apps.ReviewsDashboardConfig',
    'oscar.apps.dashboard.vouchers.apps.VouchersDashboardConfig',
    'oscar.apps.dashboard.communications.apps.CommunicationsDashboardConfig',
    'oscar.apps.dashboard.shipping.apps.ShippingDashboardConfig',

    # 3rd-party apps that oscar depends on
    'widget_tweaks',
    'haystack',
    'treebeard',
    'sorl.thumbnail',   # Default thumbnail backend, can be replaced
    'django_tables2',    

]

SITE_ID = 1


settings.MIDDLEWARE += (
    'oscar.apps.basket.middleware.BasketMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',    
)


settings.TEMPLATES[0]['DIRS'] += ['templates']

settings.TEMPLATES[0]['OPTIONS']['context_processors'] += ['oscar.apps.search.context_processors.search_form',
                                                            'oscar.apps.checkout.context_processors.checkout',
                                                            'oscar.apps.communication.notifications.context_processors.notifications',
                                                            'oscar.core.context_processors.metadata']


AUTHENTICATION_BACKENDS = (
    'oscar.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': settings.BASE_DIR / 'whoosh_index',
    },
}



OSCAR_SHOP_NAME = "Book Store"
OSCAR_SHOP_TAGLINE = "All kinds of books!"

OSCAR_DEFAULT_CURRENCY = 'EUR'

OSCAR_REQUIRED_ADDRESS_FIELDS = ('first_name', 'last_name', 'line1', 'postcode')

OSCAR_ALLOW_ANON_REVIEWS = False
OSCAR_MODERATE_REVIEWS = True

THUMBNAIL_FORMAT = 'PNG'


OSCAR_DASHBOARD_NAVIGATION += [
     {
         'label': 'Shipping',
         'children': [
             {
                 'label': 'Shipping',
                 'url_name': 'dashboard:shipping-method-list',
             },
          ]
     },
]


OSCAR_FROM_EMAIL = 'Team jaimedcsilva <example@gmail.com>'