{"id":24603677,"url":"https://github.com/apkawa/django-subscribe-form","last_synced_at":"2025-06-26T18:32:33.933Z","repository":{"id":66453213,"uuid":"109419327","full_name":"Apkawa/django-subscribe-form","owner":"Apkawa","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-28T08:26:48.000Z","size":570,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T08:49:48.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Apkawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-03T16:39:13.000Z","updated_at":"2019-04-01T11:57:12.000Z","dependencies_parsed_at":"2025-03-18T08:43:11.283Z","dependency_job_id":"a3b45ed3-5c3b-4382-9ad8-7e7b9b518b89","html_url":"https://github.com/Apkawa/django-subscribe-form","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Apkawa/django-subscribe-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apkawa%2Fdjango-subscribe-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apkawa%2Fdjango-subscribe-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apkawa%2Fdjango-subscribe-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apkawa%2Fdjango-subscribe-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apkawa","download_url":"https://codeload.github.com/Apkawa/django-subscribe-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apkawa%2Fdjango-subscribe-form/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262122954,"owners_count":23262503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-24T15:15:35.312Z","updated_at":"2025-06-26T18:32:33.855Z","avatar_url":"https://github.com/Apkawa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Apkawa/django-multitype-file-field.svg?branch=master)](https://travis-ci.org/Apkawa/django-multitype-file-field)\n[![Coverage Status](https://coveralls.io/repos/github/Apkawa/django-multitype-file-field/badge.svg)](https://coveralls.io/github/Apkawa/django-multitype-file-field)\n[![codecov](https://codecov.io/gh/Apkawa/django-multitype-file-field/branch/master/graph/badge.svg)](https://codecov.io/gh/Apkawa/django-multitype-file-field)\n[![Requirements Status](https://requires.io/github/Apkawa/django-multitype-file-field/requirements.svg?branch=master)](https://requires.io/github/Apkawa/django-multitype-file-field/requirements/?branch=master)\n[![PyPI](https://img.shields.io/pypi/pyversions/django-multitype-file-field.svg)]()\n\nProject for merging different file types, as example easy thumbnail image and unpacking archive in one field\n\n# Installation\n\n```bash\npip install django-subscribe-form\n\n```\n\nor from git\n\n```bash\npip install -e git+https://github.com/Apkawa/django-subscribe-form.git#egg=django-subscribe-form\n```\n\n## Django and python version\n\n* python-2.7 - django\u003e=1.8,\u003c=1.11\n* python-3.4 - django\u003e=1.8,\u003c=1.11\n* python-3.5 - django\u003e=1.8,\u003c=1.11\n* python-3.6 - django\u003e=1.11\n\n\n# Configuration\n\n1. Add to `INSTALLED_APPS` `post_office`, `corsheaders` and `subscribe_form` \n\n```python\nINSTALLED_APPS = [\n    #...\n    'post_office',\n    'subscribe_form',\n    #...\n]\n```\n2. Configure `corsheaders`\n```python\n\nMIDDLEWARE_CLASSES = (\n    #...\n    'corsheaders.middleware.CorsMiddleware',\n    #...\n    )\nCORS_ORIGIN_ALLOW_ALL = True\nCORS_ALLOW_CREDENTIALS = True\nfrom corsheaders.defaults import default_headers\n\nCORS_ALLOW_HEADERS = default_headers + (\n    'api-key',\n)\n```\n2. Add to `urls.py`\n\n```python\n\nfrom django.conf.urls import include, url\n\nurlpatterns = [\n    url(r'^subscribe/', include('subscribe_form.urls')),\n]\n```\n3. Run migrations\n```bash\n./manage migrate\n```\n\n# Usage\n\n1. Create `post_office.EmailTemplate` instance in admin\n[http://127.0.0.1:8000/admin/post_office/emailtemplate/add/](http://127.0.0.1:8000/admin/post_office/emailtemplate/add/)\n\nExample content fields\n\n* `subject`\n```\nFrom site {{ host }} was submited form from {{ fields.full_name.value|default:email }}\n\n```\n* `content`\n```\n{{ fields.full_name.value }}\n{% for key,field in fields.items %}\n{{ field.display_name|default:key }}: {{ field.value }}\n{% endfor %}\n\nHost: {{ host }}\nReferer: {{ referer }}\n```\n2. Create `subscribe_form.EmailTemplate` instance\n[http://127.0.0.1:8000/admin/subscribe_form/emailtemplate/add/](http://127.0.0.1:8000/admin/subscribe_form/emailtemplate/add/)\n\n3. Create `subscrube_form.Form` instance and get emdedding code\n\n4. Add embedding code to page:\n```\n    \u003cscript \n     data-endpoint=\"//example.com/api/v1/subscribe/subscribe/\" \n     data-key=\"4a96f68d-7acb-4f7f-8e43-63e8902bf08f\" \n     src=\"//example.com/static/subscribe_form/js/subscribe.js?r=dev\"\u003e\n     \u003c/script\u003e\n```\n\n# API\n\n\n\n## Simple usage\n```\ncurl -X POST //example.com/api/v1/subscribe/subscribe/ \\\n    -H \"Content-Type: multipart/form-data\" \\\n    -H 'API-Key: 4a96f68d-7acb-4f7f-8e43-63e8902bf08f' \\\n    -H 'Accept: application/json' \\\n    -F form_data='[{\"value\": \"example@email.com\", \"display_name\": \"User email*\", \"name\": \"email\", \"is_file\": false}]' \n```\n\n## Send file\n```\ncurl -X POST //example.com/api/v1/subscribe/subscribe/ \\\n    -H \"Content-Type: multipart/form-data\" \\\n    -H 'API-Key: 4a96f68d-7acb-4f7f-8e43-63e8902bf08f' \\\n    -H 'Accept: application/json' \\\n    -F form_data='[{\"display_name\": \"User avatar*\", \"name\": \"avatar\", \"is_file\": true}]'  \\\n    -F \"avatar=@/home/user/avatar.png\"  \\\n```\n\n\n\n# Contributing\n\n## run tests\n\n```bash\npip install -r requirements.txt\n./test/manage.py migrate\npytest\ntox\n```\n\n## publish pypi\n\n```bash\npython setup.py sdist upload -r pypi\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapkawa%2Fdjango-subscribe-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapkawa%2Fdjango-subscribe-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapkawa%2Fdjango-subscribe-form/lists"}