Relative Content

Tag Archive for pythondjangoe-commercereferralsdata-caching

Where to store referral code until purchasing somthing in django ecommerce website

I am new to django and I have an ecommerce shop.
Now I have added a referral link feature in which after ordering a unique link will be generated and other can come to the website using that link.
the referral link url is somthing like this : http://127.0.0.1:8000/orders/referral/qEAKfbOx15n3maHKtgBmhflH1ISPo45q
And the url pattern is : path('referral/<str:unique_id>/', views.referral, name='referral')
I am redirecting referral user to store page and pass unique id in referral view:
def referral(request, unique_id): if get_object_or_404(OriginOrder, unique_id=unique_id): return redirect(reverse("store") + "?u_id=" + unique_id)