Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it suitable with a DRF project? #54

Open
SHxKM opened this issue Nov 24, 2019 · 3 comments
Open

Is it suitable with a DRF project? #54

SHxKM opened this issue Nov 24, 2019 · 3 comments

Comments

@SHxKM
Copy link

SHxKM commented Nov 24, 2019

I see a lot of references to Django HTML templates. Is this library suitable for apps that use Django only as a backend (API with Django REST Framework)? Is it possible to only record referral action on (for example) payment rather than visits/registrations?

@KatherineMichel
Copy link
Member

There's actually just one template in this app: _create_referral_form.html, which has a button to create the referral link. If you are talking about template.Node (

class ReferralResponsesNode(template.Node):
), that refers to the custom template tag creation process and nodes that are created when Django splits the html template (https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/#a-quick-overview). Some of the Pinax apps have no templates at all, because they are simply backend. You can customize pinax-referrals however you want, including incorporating with DRF. Not sure about recording payment actions, but looks like classmethod Referral.record_response might be the starting point... ? https://github.com/pinax/pinax-referrals/blob/71b4d2fcadb9137537984359c1aca145a3c780e0/README.md#referralrecord_response

@KatherineMichel
Copy link
Member

@SHxKM Don't know if this is of interest to you, but @rosscdh has opened a PR in pinax-comments with the intention of starting a discussion about implementing DRF. Adding DRF into Pinax is probably more opinionated than what the original authors intended (Pinax also includes pinax-api btw, which alas hasn't been updated in a while), but I'd be interested to know what @paltman and @jtauber think. You can always fork the repo and add DRF yourself too. pinax/pinax-comments#30

@nandanchandra
Copy link

Yes for djangorestframework==3.12.4 its is most compatible , not sure about payment .
It is possible to integrate payment link from payment provider using Referral.record_response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants