Override template problem

172 views
Skip to first unread message

YusufSalahAdDin

unread,
Aug 11, 2016, 4:00:25 AM8/11/16
to django-oscar

Hi guys, i'm trying implements paymen methos but i can't set properly the template overriding.

I have this project structure:




And i have this setting configuration:
location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)


THIRD_PARTY_APPS = [
 'jet.dashboard',
 'jet',

 'axes',
 'cashondelivery',
 'django_extensions',
 'oscarapi',
 'paypal',
 'payu',
 'rest_framework',
 'robots',
 'widget_tweaks',
 'webpack_loader',
]

TEMPLATES = [
 {
 'BACKEND': 'django.template.backends.django.DjangoTemplates',
 'DIRS': [
 # os.path.join(BASE_DIR, 'templates'),
 location('templates'),
 OSCAR_MAIN_TEMPLATE_DIR,
 ],
 # 'APP_DIRS': True,
 'OPTIONS': {
 'context_processors': [
 'django.template.context_processors.debug',
 'django.template.context_processors.request',
 'django.contrib.auth.context_processors.auth',
 'django.contrib.messages.context_processors.messages',

 'django.template.context_processors.i18n',
 'django.template.context_processors.media',
 'django.template.context_processors.tz',
 'django.template.context_processors.static',

 'oscar.apps.search.context_processors.search_form',
 'oscar.apps.promotions.context_processors.promotions',
 'oscar.apps.checkout.context_processors.checkout',
 'oscar.apps.customer.notifications.context_processors.notifications',
 'oscar.core.context_processors.metadata',
 ],
 'loaders': [
 # ('django.template.loaders.cached.Loader', [
 'django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader',
 'django.template.loaders.eggs.Loader',
 # ]),
 ],
 },
 },
]


But i'm getting this error:





I inspect the templates whit debug toolbar and i found this:



But, i don't understand what happen here.


Can anyone help me?


YusufSalahAdDin

unread,
Aug 11, 2016, 9:54:46 PM8/11/16
to django-oscar

I get this result:


Changing my settings to this:


location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', x)

TEMPLATES
= [

But, i can't get the result.

arthu...@studio-automatique.com

unread,
Aug 15, 2016, 2:18:22 AM8/15/16
to django-oscar
Have you installed and set up a payment gateway library as mentioned? You'll need to have a Oscar compatible payment app installed first before being able to override the checkout/payment_details.html template. The payment app will contain the view and template that overrides this default template.

YusufSalahAdDin

unread,
Aug 15, 2016, 3:28:03 AM8/15/16
to django-oscar
Oh yes man, i setup both packages:
                ('django.template.loaders.cached.Loader', [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader',
                ]),
],
},
},
]
OSCAR_DASHBOARD_NAVIGATION += [
{
'label': _('Payments'),
'icon': 'icon-credit-card',
'children': [
# TODO: Group links by service
# TODO: Add detailed view urls (is it needed?)
{
'label': _('PayPal Express Transactions'),
'url_name': 'paypal-express-list',
},
{
'label': _('PayU Transactions'),
'url_name': 'payu-nonseamless-list',
},
{
'label': _('COD Transaction'),
'url_name': 'cashondelivery-transaction-list',
},
]
},
]

url(r'^checkout/paypal/', include('paypal.express.urls')),
url(r'^dashboard/paypal/express/', include(paypal.urls)),
url(r'^dashboard/payu/', include(payu.urls)),
url(r'^dashboard/cash-on/', include(cashon.urls)),

I can see the paymen modules in dashboard, and i have now a problem in the bascket because django-oscar-payu redirect view have a big problem.

In the IRC channel people say me this:
I have to handle payment methods, but i don't understand how do this.

Can you explain me this please?

arthu...@studio-automatique.com

unread,
Aug 15, 2016, 3:53:51 AM8/15/16
to django-oscar
Have a look at the sandbox site for Django Oscar PayPal for how an example of how to setup an Oscar payment module.


You can use the PayPal module as a reference as to what you need to implement in the PayU module for handling checkout and payment. Please also refer to the Oscar documentation for Checkout for the checkout and payment flow, and where the payment handling should be done.

YusufSalahAdDin

unread,
Aug 15, 2016, 4:28:55 AM8/15/16
to django-oscar
Thank you very much man, i'm  fool but, i'm understanding.

Thank you for answer me.
Reply all
Reply to author
Forward
0 new messages