{"id":18737422,"url":"https://github.com/yifaneye/django-sales","last_synced_at":"2026-04-17T10:31:03.062Z","repository":{"id":57421763,"uuid":"306263280","full_name":"yifaneye/django-sales","owner":"yifaneye","description":"👨‍💼 Django app for displaying referer details based on query parameter and cookie.  👉 pip install django-sales (Please also see https://github.com/yifaneye/django-referer for achieving the same without the use of cookie)","archived":false,"fork":false,"pushed_at":"2020-11-03T02:21:37.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T18:24:34.349Z","etag":null,"topics":["context-processor","cookie","django","django-app","django-sales","middleware","python","query-parameter"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-sales/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yifaneye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-22T07:54:21.000Z","updated_at":"2023-07-24T14:10:30.000Z","dependencies_parsed_at":"2022-09-10T13:21:53.963Z","dependency_job_id":null,"html_url":"https://github.com/yifaneye/django-sales","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yifaneye/django-sales","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yifaneye%2Fdjango-sales","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yifaneye%2Fdjango-sales/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yifaneye%2Fdjango-sales/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yifaneye%2Fdjango-sales/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yifaneye","download_url":"https://codeload.github.com/yifaneye/django-sales/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yifaneye%2Fdjango-sales/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31925258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:19:20.377Z","status":"ssl_error","status_checked_at":"2026-04-17T10:19:18.682Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context-processor","cookie","django","django-app","django-sales","middleware","python","query-parameter"],"created_at":"2024-11-07T15:25:04.459Z","updated_at":"2026-04-17T10:31:03.045Z","avatar_url":"https://github.com/yifaneye.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-sales\n\ndjango-sales is a Django app for displaying different contact details based on query parameter (with cookie).\nIt provides sales, partners and affiliates custom links to send out to the public.\nIt gives sales, partners and affiliates their opportunity to convert every contact detail on the website to their own.\nIt thus encourages sales, partners and affiliates to promote the website and the business. \n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install django-sales.\n\n```bash\npip install django-sales\n```\n\n## Usage\n\n### Step 1. Add sales app (in settings.py file)\n```python\nINSTALLED_APPS = [\n    '...',\n    'django.contrib.staticfiles',\n    'sales',  # here \n    'myapp',\n    '...',\n]\n```\n\nMake sure sales app is before all custom apps. \nOtherwise, Django will not recognize the 'sales' template tag.\n\n### Step 2. Add sales middleware (in settings.py file)\n```python\nMIDDLEWARE = [\n    'sales.middleware.sales.SalesMiddleware',  # here \n    'django.middleware.security.SecurityMiddleware',\n    '...'\n]\n```\n\n### Step 3. Add sales context processors (in settings.py file)\n```python\nTEMPLATES = [\n    {\n        'OPTIONS': {\n            'context_processors': [\n                '...',\n                'django.contrib.messages.context_processors.messages',\n                'sales.context_processors.sales',  # here\n            ],\n        },\n    },\n]\n```\n\n### Step 4. Customize sales settings (in settings.py file) (optional)\nThe defaults are:\n```python\nSALES_LINK_PARAMETER = 'sales'\nSALES_DEFAULT_ID = 1  # ?sales=1\nSALES_COOKIE_NAME = 'sales'\nSALES_COOKIE_MAX_AGE = 3600  # 1 hour\nSALES_MODEL_FROM = 'django.contrib.auth.models'\nSALES_MODEL_IMPORT = 'User'  # from SALES_MODEL_FROM import SALES_MODEL_IMPORT\n```\nIn version 0.0.1, django-sales makes use of django.contrib.auth.models.User model, which can be easily extended according to your needs. (e.g. Add a phone number field)\nFrom version 0.1.0, django-sales allows developer to specify the Sales model to lookup sales, partners and affiliates.\n\n### Step 5. Load sales tag (in any .html file)\n```html\n{% load static %}\n{% load sales %}  # here\n```\n\n### Step 6. Build sales links (in any .html file)\n```html\n\u003ca href=\"{% sales '/' %}\"\u003eHome\u003c/a\u003e\n\u003ca href=\"{% sales '/contact' %}\"\u003eContact\u003c/a\u003e\n```\n\n### Step 7. Display sales information (in relevant .html files)\n```html\n\u003ca href=\"mailto:{{ sales.email }}\"\u003eEmail\u003c/a\u003e\n\u003cp\u003e{{ sales.first_name }} {{ sales.last_name }}\u003c/p\u003e\n```\n\n## Contributing\nPull requests are welcome.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyifaneye%2Fdjango-sales","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyifaneye%2Fdjango-sales","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyifaneye%2Fdjango-sales/lists"}