{"id":21574418,"url":"https://github.com/swing-collection/swing-hello","last_synced_at":"2026-02-27T19:11:39.435Z","repository":{"id":252921170,"uuid":"821709172","full_name":"swing-collection/swing-hello","owner":"swing-collection","description":"Django Swing | Hello","archived":false,"fork":false,"pushed_at":"2026-02-15T07:02:33.000Z","size":2076,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2026-02-15T13:31:05.529Z","etag":null,"topics":["django","hello","hello-world","swing","swing-collection"],"latest_commit_sha":null,"homepage":"https://www.swing.dj","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swing-collection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"scape-foundation","open_collective":"scape"}},"created_at":"2024-06-29T08:00:11.000Z","updated_at":"2026-02-15T07:02:30.000Z","dependencies_parsed_at":"2024-11-30T11:46:17.936Z","dependency_job_id":"590c9a01-0a62-4752-b15b-62b5be2e7402","html_url":"https://github.com/swing-collection/swing-hello","commit_stats":null,"previous_names":["swing-collection/swing-hello","scape-agency/swing-hello"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/swing-collection/swing-hello","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swing-collection%2Fswing-hello","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swing-collection%2Fswing-hello/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swing-collection%2Fswing-hello/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swing-collection%2Fswing-hello/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swing-collection","download_url":"https://codeload.github.com/swing-collection/swing-hello/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swing-collection%2Fswing-hello/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29909362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"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":["django","hello","hello-world","swing","swing-collection"],"created_at":"2024-11-24T12:09:43.645Z","updated_at":"2026-02-27T19:11:39.419Z","avatar_url":"https://github.com/swing-collection.png","language":"Python","funding_links":["https://github.com/sponsors/scape-foundation","https://opencollective.com/scape"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/scape-agency/swing.dj/blob/85830584264bca52c02e1f0dcfa3648f84783805/res/swing-logo.png\" width=\"20%\" height=\"20%\" alt=\"Django Swing Logo\"\u003e\n\u003c/p\u003e\n\u003ch1 align='center' style='border-bottom: none;'\u003eSwing Hello\u003c/h1\u003e\n\u003ch3 align='center'\u003eDjango Swing Collection\u003c/h3\u003e\n\u003cbr/\u003e\n\n---\n\n## Introduction\n\n**Swing Hello** is a simple reusable Django application that provides basic views to demonstrate response handling and template rendering. It is designed to provide simple, yet effective functionality for greeting users through various forms and views. This package includes both function-based and class-based views for returning plain text and rendering templates with context. It showcases the best practices in Django app development, including internationalization, testing, and modular design.\n\n---\n\n## Features\n\n- Function-based view returning a plain text \"Hello!\" response.\n- Class-based view returning a plain text \"Hello!\" response.\n- Function-based view rendering a template with a context.\n- Class-based view rendering a template with a context.\n\n---\n\n## Installation\n\n1. Ensure you have Django installed. If not, you can install it using pip:\n\n   ```bash\n   pip install django\n   ```\n\n2. Clone the repository or download the package and include it in your Django project.\n\n## Setup\n\n1. Add `swing_hello` to your Django project's `INSTALLED_APPS` in `settings.py`:\n\n   ```python\n   INSTALLED_APPS = [\n       ...\n       'swing_hello',\n   ]\n   ```\n\n2. Include the `swing_hello` URLs in your project's `urls.py`:\n\n   ```python\n   from django.urls import path, include\n\n   urlpatterns = [\n       ...\n       path('hello/', include('swing_hello.urls')),\n   ]\n   ```\n\n---\n\n## Usage\n\n### Function-Based Views\n\n- `hello_response_view`: Returns a plain text \"Hello!\" response.\n- `hello_template_view`: Renders a template with a context.\n\n### Class-Based Views\n\n- `HelloResponseView`: Returns a plain text \"Hello!\" response.\n- `HelloTemplateView`: Renders a template with a context.\n\n### URL Patterns\n\nThe package provides the following URL patterns:\n\n- `/hello/` - Renders the template with context using `HelloTemplateView`.\n- `/hello/response` - Returns a plain text \"Hello!\" response using `HelloResponseView`.\n- `/hello/template` - Renders the template with context using `HelloTemplateView`.\n\n---\n\n## Example Template\n\nThe package includes a simple HTML template `hello.html`:\n\n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003ctitle\u003e{{ title }}\u003c/title\u003e\n    \u003cstyle\u003e\n        body {\n            font-family: Arial, sans-serif;\n            line-height: 1.6;\n            margin: 0;\n            padding: 0;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            height: 100vh;\n            background-color: #f4f4f4;\n        }\n        .container {\n            background: #fff;\n            padding: 20px;\n            border-radius: 8px;\n            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n            text-align: center;\n        }\n        h1 {\n            margin-bottom: 20px;\n            color: #333;\n        }\n        p {\n            color: #666;\n        }\n    \u003c/style\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cdiv class=\"container\"\u003e\n        \u003ch1\u003e{{ title }}\u003c/h1\u003e\n        \u003cp\u003e{{ content }}\u003c/p\u003e\n    \u003c/div\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\n---\n\n## Project Structure\n\n``` bash\nswing_hello/\n├── demo/                       # This directory contains a sample Django project for testing your reusable app (swing_hello).\n│   ├── manage.py               # Entry point for managing the demo project.\n│   ├── demo/\n│   │   ├── __init__.py\n│   │   ├── settings.py         # Configuration for the demo project.\n│   │   ├── urls.py             # Main URL configuration for testing.\n│   │   └── wsgi.py\n│   └── db.sqlite3\n├── src/\n│   ├── swing_hello/            # Core directory of your reusable Django app.\n│       ├── __init__.py         # Initializes the Python module.\n│       ├── __main__.py\n│       ├── apps.py             # Defines the app configuration for Django.\n│       ├── urls.py             # URLs specific to this app.\n│       ├── forms/              # Contains Django forms (e.g., form_hello.py).\n│       │   ├── __init__.py\n│       │   └── form_hello.py\n│       ├── locale/             # Holds translation files for internationalization (e.g., en, nl).\n│       │   ├── en/\n│       │   │   └── ...\n│       │   └── nl/\n│       │       └── ...\n│       ├── migrations/         # Contains migration scripts for the app.\n│       │   ├── __init__.py\n│       │   └── ...\n│       ├── static/             # Stores app-specific static files (e.g., styles.css).\n│       │   └── swing_hello/\n│       │       └── styles.css\n│       ├── templates/          # App-specific templates (e.g., hello_template.html).\n│       │   └── swing_hello/\n│       │       ├── hello_form.html\n│       │       └── hello_template.html\n│       ├── tests/              # Test cases for the app (e.g., test_hello_form.py).\n│       │   ├── __init__.py\n│       │   ├── test_hello_form.py\n│       │   ├── test_hello_json.py\n│       │   ├── test_hello_response.py\n│       │   ├── test_hello_template.py\n│       │   └── ...\n│       └── views/              # App views organized by functionality (e.g., view_hello_form.py).\n│           ├── __init__.py\n│           ├── view_hello_form.py\n│           ├── view_hello_json.py\n│           ├── view_hello_response.py\n│           ├── view_hello_template.py\n│           └── ...\n├── setup.py                    # Configuration for packaging and distributing the app.\n├── README.md                   # Documentation for the repository.\n└── LICENSE                     # Specifies the license for the project.\n```\n\n---\n\n## Colophon\n\nMade with ❤️ by **[Scape Agency](https://www.scape.agency)**\n\n### Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\n\n### License\n\nThis project is licensed under the BSD-3-Clause license. See the [LICENSE](LICENSE) file for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswing-collection%2Fswing-hello","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswing-collection%2Fswing-hello","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswing-collection%2Fswing-hello/lists"}