{
"info": {
"author": "st4lk",
"author_email": "alexevseev@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Utilities"
],
"description": "Affiliate system for django\n===========================\n\n|Build Status| |Coverage Status| |Pypi version|\n\nAffiliate system to reward partners with their visitors payments.\nContains abstract models with basic functionality, so it is easy to\nsubclass them and add your custom logic and relations.\n\n**Note**: version 0.2.0 is backwards incompatible with previous\nversions.\n\nExample\n-------\n\nVisitor goes to site with affiliate code:\n\n::\n\n http://site.com/?aid=12345\n\nThis code is saved in his cookies (also another way is supported: keep\naid=12345 at every url). Now each request object has property\n``request.affiliate``, so you can access to affiliate, that attract\ncurrent visitor, and therefore reward him at needed event.\n\nProperty ``request.affiliate`` is lazy. To check, that affiliate exist,\ndo this:\n\n::\n\n if request.affiliate.exists():\n # optionally check, that he is active:\n if request.affiliate.is_active:\n # request comes from affiliate with code \n # affiliate.aid\n\nYou can find example project in this repository.\n\nUsed by projects\n----------------\n\n- `builds.io `__\n- `wirelayer.net `__\n- `smmplanner.com `__\n\nRequirements\n------------\n\n- python (2.7, 3.4, 3.5)\n- django (1.6, 1.7, 1.8, 1.9)\n\nQuick start\n-----------\n\n1. Install this package to your python distribution\n\n ::\n\n pip install django-affiliate\n\n2. Add 'affiliate' to INSTALLED\\_APP:\n\n ::\n\n INSTALLED_APPS = [\n # ...\n 'affiliate',\n ]\n\n3. Add 'affiliate.middleware.AffiliateMiddleware' to\n MIDDLEWARE\\_CLASSES:\n\n ::\n\n MIDDLEWARE_CLASSES = (\n # ...\n 'affiliate.middleware.AffiliateMiddleware',\n )\n\n4. Define your custom affiliate model (similar to custom user model):\n\n ::\n\n # our_app/models.py\n from django.db import models\n from affiliate.models import AbstractAffiliate\n\n\n class Affiliate(AbstractAffiliate):\n pass # or add some your custom fields here\n\n # settngs.py\n AFFILIATE_AFFILIATE_MODEL = 'our_app.Affiliate'\n\n5. Create tables\n\n ::\n\n # django <= 1.6\n python manage.py syncdb\n\n # django <= 1.6 & south\n python manage.py schemamigration our_app --auto\n python manage.py migrate our_app\n\n # django >= 1.7\n python manage.py makemigrations our_app\n python manage.py migrate our_app\n\n6. Finally, reward affiliate\n\n ::\n\n from django.views.generic import FormView\n from affiliate.tools import get_affiliate_model\n\n Affiliate = get_affiliate_model()\n\n class SomeView(FormView):\n # ...\n\n def form_valid(self.form):\n product = self.get_product()\n if self.request.affiliate.exists() and self.request.affiliate.is_active:\n # reward affiliate here, your custom logic is here\n Transaction.objects.create(\n user=self.affiliate.user,\n amount=Affiliate.calc_affiliate_reward(product.price))\n return super(SomeView, self).form_valid(form)\n\nOptional\n^^^^^^^^\n\nTo always keep the aid GET parameter (maybe you don't trust the cookies\nor you want to reward affiliate only if his visitor make payment at\ncurrent link access, and not tomorrow)\n\n1. Load 'affiliate\\_urls' tags:\n\n ::\n\n {% load affiliate_urls %}\n\n2. Use 'url\\_aff' instead of 'url' template tag:\n\n ::\n\n Home\n\nConfiguration\n-------------\n\nDefine in settings.py\n\n- AFFILIATE\\_AFFILIATE\\_MODEL - the model to use to represent an\n Affiliate, similar to\n `AUTH\\_USER\\_MODEL `__.\n Mandatory, must be explicitly defined.\n- AFFILIATE\\_PARAM\\_NAME - name of affiliate GET parameter in url.\n Default ``'aid'``.\n- AFFILIATE\\_REWARD\\_AMOUNT - default affiliate reward amount. Can be\n set as string (``'5.55'``) or as int (``10``). Default ``10``.\n- AFFILIATE\\_REWARD\\_PERCENTAGE - if True, ``AFFILIATE_REWARD_AMOUNT``\n is treated as percentage. Otherwise as exact amount of money. Default\n ``True``.\n- AFFILIATE\\_SAVE\\_IN\\_SESSION - save affiliate id in session or not.\n Default ``True``.\n- AFFILIATE\\_SESSION\\_AGE - how long keep affiliate id in session, in\n seconds. Default ``5 * 24 * 60 * 60`` seconds (5 days).\n- AFFILIATE\\_DEFAULT\\_LINK - default link, that will be used by\n ``Affiliate.build_absolute_affiliate_uri`` and\n ``.build_affiliate_url``. Default ``'/'``.\n- AFFILIATE\\_REMOVE\\_PARAM\\_AND\\_REDIRECT - if True, remove affiliate\n param from url and redirect to same url (affiliate data will be saved\n in session). Default ``False``.\n\n.. |Build Status| image:: https://travis-ci.org/st4lk/django-affiliate.svg?branch=master\n :target: https://travis-ci.org/st4lk/django-affiliate\n.. |Coverage Status| image:: https://coveralls.io/repos/st4lk/django-affiliate/badge.svg?branch=master\n :target: https://coveralls.io/r/st4lk/django-affiliate?branch=master\n.. |Pypi version| image:: https://img.shields.io/pypi/v/django-affiliate.svg\n :target: https://pypi.python.org/pypi/django-affiliate\n\n\ndjango-affiliate release notes\n==============================\n\nv0.4.0 (2016-05-24)\n-------------------\n\n- django 1.9 support\n- python 3.5 support\n\nIssues: #12\n\nv0.3.3 (2016-04-10)\n-------------------\n\n- Don't raise exception in case of bad aid code type\n\nIssues: #10\n\nv0.3.2 (2016-11-29)\n-------------------\n\n- if AFFILIATE\\_REMOVE\\_PARAM\\_AND\\_REDIRECT is True, perform redirect\n only in case of GET request method\n\nv0.3.1 (2015-11-29)\n-------------------\n\n- add setting AFFILIATE\\_REMOVE\\_PARAM\\_AND\\_REDIRECT, that allows to\n remove affiliate param from url and redirect\n\nv0.2.1 (2015-10-29)\n-------------------\n\n- add translations to pypi\n\nv0.2.0 (2015-10-29)\n-------------------\n\n- only affiliate model defined by package\n- request now have lazy ``affiliate`` property, returns Affiliate\n instance (if exists)\n- django 1.7, 1.8 support\n- python 3.4 support\n- tests are added\n- backwards incompatible\n\nIssues: #1, #3, #4, #6, #8\n\nv0.1.1 (2015-01-15)\n-------------------\n\n- uploaded to pypi\n- small bug fixes\n\nv0.1.0 (2014-04-29)\n-------------------\n\n- affiliate model\n- statistics models\n- means for withdraw request",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/st4lk/django-affiliate",
"keywords": "django,affiliate,urls,track",
"license": "BSD License",
"maintainer": null,
"maintainer_email": null,
"name": "django-affiliate",
"package_url": "https://pypi.org/project/django-affiliate/",
"platform": "Any",
"project_url": "https://pypi.org/project/django-affiliate/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/st4lk/django-affiliate"
},
"release_url": "https://pypi.org/project/django-affiliate/0.4.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Affiliate system for django",
"version": "0.4.0"
},
"last_serial": 2129955,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "e4604861f9a9ecc011d79141de7c23fc",
"sha256": "bfb2e1c0c0ae49ba67b0316ec9708723520fa5d85672c7ff10b0f3bd72985fab"
},
"downloads": -1,
"filename": "django-affiliate-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e4604861f9a9ecc011d79141de7c23fc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10746,
"upload_time": "2015-01-14T22:24:59",
"url": "https://files.pythonhosted.org/packages/e3/e9/516434bf9ebeabd8a3426df0788944779203c821338214ae9be9f9e79224/django-affiliate-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "1048c9e4fc9b4c59a2023cb8c7126b93",
"sha256": "a1f4efa9fb862fa6b46c487cff66afcf74f47504920b0d341346de8f59f30403"
},
"downloads": -1,
"filename": "django-affiliate-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "1048c9e4fc9b4c59a2023cb8c7126b93",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11709,
"upload_time": "2015-01-14T22:33:54",
"url": "https://files.pythonhosted.org/packages/53/80/f4926e2bb2252d3b3e35d68e018ca9ce02ce12a2967ce7dd391d1198966c/django-affiliate-0.1.1.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "160ae3f20bd06df77380af1786175a97",
"sha256": "cd2788b58516e92ea03acdd090b98adab85fa7441945db04c992d4110f38eb99"
},
"downloads": -1,
"filename": "django_affiliate-0.2.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "160ae3f20bd06df77380af1786175a97",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 16189,
"upload_time": "2015-10-29T14:24:12",
"url": "https://files.pythonhosted.org/packages/9a/8b/c059bc213584d9c266ebd6710d01f88fea5d441d2f1cdc98528a5e4c2457/django_affiliate-0.2.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "57a92f24f4506a3c09f6338da56f1794",
"sha256": "13df6e19652634e408f5105cf33b5bb4ecb88a85fe856afb6ee781878cbeaa5e"
},
"downloads": -1,
"filename": "django-affiliate-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "57a92f24f4506a3c09f6338da56f1794",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10564,
"upload_time": "2015-10-29T14:22:35",
"url": "https://files.pythonhosted.org/packages/41/10/44ab1b7fe374de3db25eec24362b5b540125b86ce3fac39e522503a2eb62/django-affiliate-0.2.0.tar.gz"
}
],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "085ae938a148eddcae2cd874b951a7a9",
"sha256": "51e0c1a1121907ebe7da396852af6942d9a1189be7db7cc4606a6204b9a765bc"
},
"downloads": -1,
"filename": "django_affiliate-0.2.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "085ae938a148eddcae2cd874b951a7a9",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 29248,
"upload_time": "2015-10-29T14:32:39",
"url": "https://files.pythonhosted.org/packages/3c/b2/1071de3a75b255ca6b636777ec6f213e0508c64e9ab03ed63d3718dba81c/django_affiliate-0.2.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "2b55d8a747261cb9b9c82f5acfc69e46",
"sha256": "eb1371a9cd09de1ad335ad08a29c3eb88bfb070a35dff529eab2c87bbaddd5f7"
},
"downloads": -1,
"filename": "django-affiliate-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2b55d8a747261cb9b9c82f5acfc69e46",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18939,
"upload_time": "2015-10-29T14:32:28",
"url": "https://files.pythonhosted.org/packages/8d/dd/04945df9b9a34b37f7b63cc699154d8635649de5fe2bf5fa166a4bc1ebc2/django-affiliate-0.2.1.tar.gz"
}
],
"0.3.1": [
{
"comment_text": "",
"digests": {
"md5": "d1068f9abf97fd86e7d9189cd3c2da90",
"sha256": "e7924ec9bd888b58241b21f39bd032f5000b020984f743bb00258285d0548c91"
},
"downloads": -1,
"filename": "django_affiliate-0.3.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "d1068f9abf97fd86e7d9189cd3c2da90",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 29854,
"upload_time": "2015-11-02T12:05:32",
"url": "https://files.pythonhosted.org/packages/74/fc/db76685801a91ec092a00c5674603c3fc52ed232955629135ece5218ebe2/django_affiliate-0.3.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "787f02d0062a200296319d1790ae95ed",
"sha256": "278529121352d79d847e37d90dfc40728636a4ee5233a507c3c50bdd53b86b1f"
},
"downloads": -1,
"filename": "django-affiliate-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "787f02d0062a200296319d1790ae95ed",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19402,
"upload_time": "2015-11-02T12:05:24",
"url": "https://files.pythonhosted.org/packages/9e/c4/20e723e98890cd562fc9cd72d6ee7c7fea9c5e87c7598c0784dee8789fe0/django-affiliate-0.3.1.tar.gz"
}
],
"0.3.2": [
{
"comment_text": "",
"digests": {
"md5": "a2def917aeab10baf836882cafe73a72",
"sha256": "ea0ee6cc807c4ad81e0fe7a9914a2769cf379f573d61ab8beb3ff74a018e2cfa"
},
"downloads": -1,
"filename": "django_affiliate-0.3.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a2def917aeab10baf836882cafe73a72",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 30002,
"upload_time": "2015-11-02T13:23:43",
"url": "https://files.pythonhosted.org/packages/fa/64/0498293f90cd17f724dec64fd04f65dd7001f17a5cf973af88aa54833a16/django_affiliate-0.3.2-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "bb4429f575cb9a89fdbb95f77b0e4daa",
"sha256": "8392bba3e28341da924eae044a407a63f2630df39dae2f0c0c686fff3785efd1"
},
"downloads": -1,
"filename": "django-affiliate-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "bb4429f575cb9a89fdbb95f77b0e4daa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19527,
"upload_time": "2015-11-02T13:23:32",
"url": "https://files.pythonhosted.org/packages/47/9d/05d8c796bb6b7e4346ec79302b1458210a58c65aec513c44c7c5d7e674e1/django-affiliate-0.3.2.tar.gz"
}
],
"0.3.3": [
{
"comment_text": "",
"digests": {
"md5": "bc64c68b5aab8331199adaf93c9707d1",
"sha256": "a1568a75a82f3288ce7429526beb5ea86dc3aab0417be5174b491eac48115b40"
},
"downloads": -1,
"filename": "django_affiliate-0.3.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc64c68b5aab8331199adaf93c9707d1",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 30472,
"upload_time": "2016-04-10T20:46:16",
"url": "https://files.pythonhosted.org/packages/eb/3b/6a499a33fb6ca40ae63c5cde758a44daf96ba6ed4e65c1e2a97f38ab3e2e/django_affiliate-0.3.3-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "0ae4528c17c985191d7c995116789552",
"sha256": "1363f5fbbd62dc9c8465f9dc005cf65e93cc5b2ae1e42abbd6dda24d7cd13216"
},
"downloads": -1,
"filename": "django-affiliate-0.3.3.tar.gz",
"has_sig": false,
"md5_digest": "0ae4528c17c985191d7c995116789552",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19885,
"upload_time": "2016-04-10T20:45:48",
"url": "https://files.pythonhosted.org/packages/98/df/5f3ab1a6e7224fed4d828112a6a96add749329633197b3f9c30dd040e211/django-affiliate-0.3.3.tar.gz"
}
],
"0.4.0": [
{
"comment_text": "",
"digests": {
"md5": "a7a3a11b3bab2ed8993a79ba134dfbbe",
"sha256": "80ea2537d9c89c19f7c20936c2212213b17bc147b5c16cb436482cb6ae324a61"
},
"downloads": -1,
"filename": "django_affiliate-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7a3a11b3bab2ed8993a79ba134dfbbe",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 30314,
"upload_time": "2016-05-23T21:10:25",
"url": "https://files.pythonhosted.org/packages/18/cd/ef3955ac1afec6f386b3601d26678d543832629f30cd0239e8ceb55bb91f/django_affiliate-0.4.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "9efe2c5f8089609eae4532132b9e12b4",
"sha256": "bd36e7e8e1629f9b6703cb19ba6a5c95bb9f915c9ed8bf1229cdbeabb1d39e98"
},
"downloads": -1,
"filename": "django-affiliate-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "9efe2c5f8089609eae4532132b9e12b4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19774,
"upload_time": "2016-05-23T21:10:10",
"url": "https://files.pythonhosted.org/packages/de/23/ef0fd4f25a55c0d2ec57f83e8ce5cf9da223148b5ffe62e18e5fce3f53d5/django-affiliate-0.4.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "a7a3a11b3bab2ed8993a79ba134dfbbe",
"sha256": "80ea2537d9c89c19f7c20936c2212213b17bc147b5c16cb436482cb6ae324a61"
},
"downloads": -1,
"filename": "django_affiliate-0.4.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7a3a11b3bab2ed8993a79ba134dfbbe",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 30314,
"upload_time": "2016-05-23T21:10:25",
"url": "https://files.pythonhosted.org/packages/18/cd/ef3955ac1afec6f386b3601d26678d543832629f30cd0239e8ceb55bb91f/django_affiliate-0.4.0-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "9efe2c5f8089609eae4532132b9e12b4",
"sha256": "bd36e7e8e1629f9b6703cb19ba6a5c95bb9f915c9ed8bf1229cdbeabb1d39e98"
},
"downloads": -1,
"filename": "django-affiliate-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "9efe2c5f8089609eae4532132b9e12b4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19774,
"upload_time": "2016-05-23T21:10:10",
"url": "https://files.pythonhosted.org/packages/de/23/ef0fd4f25a55c0d2ec57f83e8ce5cf9da223148b5ffe62e18e5fce3f53d5/django-affiliate-0.4.0.tar.gz"
}
]
}