{"id":15180647,"url":"https://github.com/anexia/django-generic-contact","last_synced_at":"2026-02-28T16:33:14.023Z","repository":{"id":203056320,"uuid":"707615557","full_name":"anexia/django-generic-contact","owner":"anexia","description":"A django package to store contact requests in a structured but generic manner.","archived":false,"fork":false,"pushed_at":"2026-01-27T13:09:05.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-27T20:55:23.254Z","etag":null,"topics":["contact-form","django","hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/anexia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-20T09:28:52.000Z","updated_at":"2026-01-27T13:08:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f15447f6-6057-4f23-b625-c9eae461409c","html_url":"https://github.com/anexia/django-generic-contact","commit_stats":null,"previous_names":["anexia/django-generic-contact"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/anexia/django-generic-contact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anexia%2Fdjango-generic-contact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anexia%2Fdjango-generic-contact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anexia%2Fdjango-generic-contact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anexia%2Fdjango-generic-contact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anexia","download_url":"https://codeload.github.com/anexia/django-generic-contact/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anexia%2Fdjango-generic-contact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29742345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: 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":["contact-form","django","hacktoberfest"],"created_at":"2024-09-27T16:40:26.244Z","updated_at":"2026-02-28T16:33:14.005Z","avatar_url":"https://github.com/anexia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Django Generic Contact\n\n[![PyPI version](https://img.shields.io/pypi/v/django-generic-contact.svg)](https://pypi.org/project/django-generic-contact/)\n[![Run linter and tests](https://github.com/anexia/django-generic-contact/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/anexia/django-generic-contact/actions/workflows/test.yml)\n[![Codecov](https://img.shields.io/codecov/c/gh/anexia/django-generic-contact)](https://codecov.io/gh/anexia/django-generic-contact)\n\nDjango module to store contact request in a structured yet generic manner within the database.\n\nSupported versions (from endoflife.date):\n- Python: 3.10, 3.11, 3.12, 3.13, 3.14\n- Django: 4.2 (LTS), 5.2 (LTS), 6.0\n\n### Installation\n\n1. Install using pip:\n\n```shell\npip install django-generic-contact\n```\n\n2. Integrate `django_generic_contact` into your `settings.py`\n\n```python\nINSTALLED_APPS = [\n    # ...\n    'django_generic_contact',\n    # ...\n]\n```\n\n### Usage\n\nThe package provides you with a `Contact` model which expects `data` (dict) and the `name` of the requester,\nan optional `message` can be added:\n\n```\nfrom django_generic_contact.models import Contact\n\ncontact = Contact.objects.create(\n    name=\"Mr. Tester\",\n    message=\"Please contact me via email or phone.\",\n    data={\n        \"email\": \"mr@tester.com\",\n        \"phone\": \"123456\",\n    }\n)\n```\n\n#### JSON Schema validation\n\nThe contents of `data` will be validated against a [json schema](https://json-schema.org/) defined in your project's\n`settings.py` (if provided). If needed you can define `GENERIC_CONTACT_DATA_SCHEMA` to check all relevant input\naccording to the expected structure, e.g.:\n\n```\nGENERIC_CONTACT_DATA_SCHEMA = {\n    \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"email\": {\"type\": \"string\", \"format\": \"email\"},\n        \"phone\": {\"type\": \"integer\"},\n    },\n}\n```\n\nSee more examples of `GENERIC_CONTACT_DATA_SCHEMA` in `tests/testapp/tests/test_model.py`.\n\n#### Customizing the Contact model\nThe base model `GenericContact` only requires the `data`. Thus, you can let your own models inherit from this and extend\nit according to your project's needs, e.g.:\n\n```\nfrom django_generic_contact.models import GenericContact\n\nclass CustomContact(GenericContact):\n    birth_date = models.Datetime(_(\"birth date\"))\n    zip = models.CharField(_(\"zip\"))\n```\n\n## Unit Tests\n\nSee folder [tests/](tests/). The provided tests cover these criteria:\n* success:\n  * Contact model instance creation\n  * project's jsonschema validation\n* failure:\n  * project's jsonschema validation\n  * exemplary custom jsonschema validation\n\nFollow below instructions to run the tests.\nYou may exchange the installed Django and DRF versions according to your requirements.\n:warning: Depending on your local environment settings you might need to explicitly call `python3` instead of `python`.\n```bash\n# install dependencies\npython -m pip install --upgrade pip\npip install -e .[dev]\n\n# run tests\ncd tests \u0026\u0026 python manage.py test\n```\n\n### Contributing\n\nContributions are welcomed! Read the [Contributing Guide](CONTRIBUTING.md) for more information.\n\n### Licensing\n\nSee [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanexia%2Fdjango-generic-contact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanexia%2Fdjango-generic-contact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanexia%2Fdjango-generic-contact/lists"}