django-oscar-paypal integration

574 views
Skip to first unread message

new_django_dev

unread,
Oct 8, 2013, 2:55:38 PM10/8/13
to django...@googlegroups.com
I have added basket_content.html in templates/basket/partials/ and my 'templates'  dir is in "etest" dir and besides manage.py file which is also inside "etest" dir

But still I cannot see paypal's button for payment. What I see is this "This page needs implementing within your project. You may want to use on one of Oscar's payment gateway libraries:"

what should I do ??

ALso please specify any additional info if required.

This is my urls.py

from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin

from oscar.app import application
from oscar.app import shop
from paypal.express.dashboard.app import application
# Uncomment the next two lines to enable the admin:

admin.autodiscover()

urlpatterns = patterns('',
   
    url(r'^admin/', include(admin.site.urls)),
 
    url(r'', include(application.urls)),
    url(r'^checkout/paypal/', include('paypal.express.urls')),
    url(r'^dashboard/paypal/express/', include(application.urls)),
    url(r'', include(shop.urls)),
   
   
    url('^pages/', include('django.contrib.flatpages.urls')),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.MEDIA_ROOT,
        }),
   )

Izidor Matušov

unread,
Oct 9, 2013, 5:32:21 AM10/9/13
to django...@googlegroups.com
On 08/10/13 19:55, new_django_dev wrote:
> I have added basket_content.html in templates/basket/partials/ and my
> 'templates' dir is in "etest" dir and besides manage.py file which is
> also inside "etest" dir
>
> But still I cannot see paypal's button for payment. What I see is this
> *"**This page needs implementing within your project. You may want to
> use on one of Oscar's payment gateway libraries:"*
>
> what should I do ??
>
> ALso please specify any additional info if required.


I assume you read the documentation[0]. There might be an issue with
resolving your templates. What are the values to the following settings?

TEMPLATE_DIRS
TEMPLATE_LOADERS

(You can easily find this out using by running

python manage.py shell
>>> from django.conf import settings
>>> settings.TEMPLATE_DIRS
>>> settings.TEMPLATE_LOADERS

Izi

0: http://django-oscar-paypal.readthedocs.org/en/latest/express.html

David Winterbottom

unread,
Oct 9, 2013, 5:54:10 AM10/9/13
to django-oscar
Also, use the debug toolbar to review which templates get loaded.  As Izidor points out, the ultimate cause is probably around template paths and loaders.




--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
--- You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-oscar/525522A5.6000007%40tangentsnowball.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
David Winterbottom
Head of Programming

Tangent Labs
84-86 Great Portland Street
London W1W 7NR
England, UK

new_django_dev

unread,
Oct 9, 2013, 1:30:51 PM10/9/13
to django...@googlegroups.com, izidor....@tangentsnowball.com
Thanks for your time. I got this in shell

In [1]: from django.conf import settings

In [2]: settings.TEMPLATE_DIRS
Out[2]:
('/vagrant/projects/ecommerce/etest/etest/templates',
 '/home/vagrant/oscar/local/lib/python2.7/site-packages/oscar/templates/oscar')

In [3]: settings.TEMPLATE_LOADERS
Out[3]:
('django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader')

new_django_dev

unread,
Oct 9, 2013, 1:42:57 PM10/9/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
Thanks for your time. Its loading the original payment_details.html which comes in oscar package The one that has all these link

<ul>
            <li><a href="https://github.com/tangentlabs/django-oscar-paypal">django-oscar-paypal</a></li>
            <li><a href="https://github.com/tangentlabs/django-oscar-datacash">django-oscar-datacash</a></li>
            <li><a href="https://github.com/tangentlabs/django-oscar-gocardless">django-oscar-gocardless</a></li>
            <li><a href="https://github.com/tangentlabs/django-oscar-paymentexpress">django-oscar-paymentexpress</a></li>
            <li><a href="https://github.com/tangentlabs/django-oscar-accounts">django-oscar-accounts</a></li>
</ul>

The payment_details.html which I have created at templates/checkout/ is not overriding the original file. I have tried changing the templates folder locations but it didn't work. I know these are basics of django but still if you could help it would be great. Again Thanks  

new_django_dev

unread,
Oct 9, 2013, 2:17:56 PM10/9/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk
I changed the "templates" folder location and it worked this time. Don't know why it didn't worked yesterday coz I tried the same thing. 

new_django_dev

unread,
Oct 9, 2013, 2:20:17 PM10/9/13
to django...@googlegroups.com, david.win...@tangentlabs.co.uk

Now I'm getting this error - "An error occurred communicating with PayPal "

Izidor Matušov

unread,
Oct 10, 2013, 6:55:18 AM10/10/13
to django...@googlegroups.com
On 09/10/13 19:20, new_django_dev wrote:
> <https://lh4.googleusercontent.com/-N2GHOVFY9Ew/UlWeTZmRQfI/AAAAAAAAAF8/i_L_LPvI93g/s1600/paypal.jpg>
>
> Now I'm getting this error - *"An error occurred communicating with
> PayPal "*

Have a look at paypal.express logs. (You might want to review logging
configuration [0]) At the moment, the guardian exceptions are not logged:

* Basket can't have negative value
* You can't pay more than $10000

PR [1] adds logging to all PayPal errors. Everything could be found in logs.

Izi


0: https://docs.djangoproject.com/en/dev/topics/logging/
1: https://github.com/tangentlabs/django-oscar-paypal/pull/45

Andres Douglas

unread,
Jan 16, 2015, 7:33:59 PM1/16/15
to django...@googlegroups.com, izidor....@tangentsnowball.com
I'm experiencing this same problem, and have those exact values for TEMPLATE_DIRS and TEMPLATE_LOADERS. Should they be different?

Having the same issue when I run the sandbox site.
Update: after looking into the sandbox it looks like it doesn't use Paypal. Should that be corrected in the docs? I know it's a nitpick, but may throw off some users.

Also missing from installation instructions are 
- adding "paypal" to installed apps
- migrating DB

Happy to add to the docs and send a PR.

David Winterbottom

unread,
Jan 21, 2015, 5:56:56 PM1/21/15
to django-oscar, izidor....@tangentsnowball.com
You've lost me. Is this the sandbox of the django-oscar-paypal repo or that of django-oscar itself?

--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages