swing-hello

Django Swing | Hello

https://github.com/swing-collection/swing-hello

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary

Keywords

django hello hello-world swing swing-collection
Last synced: 6 months ago · JSON representation ·

Repository

Django Swing | Hello

Basic Info
  • Host: GitHub
  • Owner: swing-collection
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: dev
  • Homepage: https://www.swing.dj
  • Size: 2.11 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
django hello hello-world swing swing-collection
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners Security Authors

README.md

Django Swing Logo

Swing Hello

Django Swing Collection



Introduction

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.


Features

  • Function-based view returning a plain text "Hello!" response.
  • Class-based view returning a plain text "Hello!" response.
  • Function-based view rendering a template with a context.
  • Class-based view rendering a template with a context.

Installation

  1. Ensure you have Django installed. If not, you can install it using pip:

bash pip install django

  1. Clone the repository or download the package and include it in your Django project.

Setup

  1. Add swing_hello to your Django project's INSTALLED_APPS in settings.py:

python INSTALLED_APPS = [ ... 'swing_hello', ]

  1. Include the swing_hello URLs in your project's urls.py:

```python from django.urls import path, include

urlpatterns = [ ... path('hello/', include('swing_hello.urls')), ] ```


Usage

Function-Based Views

  • hello_response_view: Returns a plain text "Hello!" response.
  • hello_template_view: Renders a template with a context.

Class-Based Views

  • HelloResponseView: Returns a plain text "Hello!" response.
  • HelloTemplateView: Renders a template with a context.

URL Patterns

The package provides the following URL patterns:

  • /hello/ - Renders the template with context using HelloTemplateView.
  • /hello/response - Returns a plain text "Hello!" response using HelloResponseView.
  • /hello/template - Renders the template with context using HelloTemplateView.

Example Template

The package includes a simple HTML template hello.html:

```html <!doctype html>

{{ title }}

{{ title }}

{{ content }}

```


Project Structure

bash swing_hello/ ├── demo/ # This directory contains a sample Django project for testing your reusable app (swing_hello). │ ├── manage.py # Entry point for managing the demo project. │ ├── demo/ │ │ ├── __init__.py │ │ ├── settings.py # Configuration for the demo project. │ │ ├── urls.py # Main URL configuration for testing. │ │ └── wsgi.py │ └── db.sqlite3 ├── src/ │ ├── swing_hello/ # Core directory of your reusable Django app. │ ├── __init__.py # Initializes the Python module. │ ├── __main__.py │ ├── apps.py # Defines the app configuration for Django. │ ├── urls.py # URLs specific to this app. │ ├── forms/ # Contains Django forms (e.g., form_hello.py). │ │ ├── __init__.py │ │ └── form_hello.py │ ├── locale/ # Holds translation files for internationalization (e.g., en, nl). │ │ ├── en/ │ │ │ └── ... │ │ └── nl/ │ │ └── ... │ ├── migrations/ # Contains migration scripts for the app. │ │ ├── __init__.py │ │ └── ... │ ├── static/ # Stores app-specific static files (e.g., styles.css). │ │ └── swing_hello/ │ │ └── styles.css │ ├── templates/ # App-specific templates (e.g., hello_template.html). │ │ └── swing_hello/ │ │ ├── hello_form.html │ │ └── hello_template.html │ ├── tests/ # Test cases for the app (e.g., test_hello_form.py). │ │ ├── __init__.py │ │ ├── test_hello_form.py │ │ ├── test_hello_json.py │ │ ├── test_hello_response.py │ │ ├── test_hello_template.py │ │ └── ... │ └── views/ # App views organized by functionality (e.g., view_hello_form.py). │ ├── __init__.py │ ├── view_hello_form.py │ ├── view_hello_json.py │ ├── view_hello_response.py │ ├── view_hello_template.py │ └── ... ├── setup.py # Configuration for packaging and distributing the app. ├── README.md # Documentation for the repository. └── LICENSE # Specifies the license for the project.


Colophon

Made with ❤️ by Scape Agency

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the BSD-3-Clause license. See the LICENSE file for details.


Owner

  • Name: Swing Collection
  • Login: swing-collection
  • Kind: organization

Django Packages

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Swing Hello"
version: 0.2.2
date-released: 2024-07-01
url: "https://github.com/swing-collection/swing-hello"
message: >-
  If you use this software, please cite it using the metadata from this file.
type: software
repository-code: "https://github.com/swing-collection/swing-hello"
license: BSD-3-Clause
abstract: >
  Swing Hello is a Django application that provides basic views for
  response handling, template rendering, form processing, and JSON
  responses. This package is designed for educational purposes and
  as a foundational starting point for Django projects.
keywords:
  - Django
  - Web Development
  - Forms
  - JSON
  - Templates
  - Python
  - Software
authors:
  - given-names: Lars Bastiaan
    family-names: van Vianen
    email: lars@scape.agency
    affiliation: Scape Agency
    orcid: "https://orcid.org/0000-0002-8790-8630"
preferred-citation:
  type: software
  authors:
    - given-names: Lars Bastiaan
      family-names: van Vianen
      orcid: "https://orcid.org/0000-0002-8790-8630"
  title: "Swing Hello"
  version: 0.1.0
  url: "https://github.com/swing-collection/swing-hello"
  date-released: 2024-07-01
  license: BSD-3-Clause

GitHub Events

Total
  • Delete event: 46
  • Issue comment event: 43
  • Push event: 84
  • Pull request event: 90
  • Create event: 56
Last Year
  • Delete event: 46
  • Issue comment event: 43
  • Push event: 84
  • Pull request event: 90
  • Create event: 56

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 83
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.02
  • Merged pull requests: 79
  • Bot issues: 0
  • Bot pull requests: 83
Past Year
  • Issues: 0
  • Pull requests: 79
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.03
  • Merged pull requests: 75
  • Bot issues: 0
  • Bot pull requests: 79
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (91)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/deploy_docs.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.devcontainer/Dockerfile docker
  • python 3.12-slim build
.devcontainer/docker-compose.yml docker
pyproject.toml pypi
  • black ^24.8.0 develop
  • flake8 ^7.1.0 develop
  • isort ^5.10.1 develop
  • mypy ^1.11.1 develop
  • pytest ^8.3.2 develop
  • pytest-cov ^5.0.0 develop
  • pytest-django ^4.5.2 develop
  • sphinx ^8.0.2 develop
  • tox ^4.4.6 develop
  • Django ^4.2
  • python ^3.8
requirements.txt pypi
  • Django >=4.2
  • black *
  • flake8 *
  • mypy *
  • pytest *
  • pytest-django *
  • sphinx *
  • sphinx-rtd-theme *
  • tox *
setup.py pypi
.github/workflows/dependabot-auto-merge.yml actions
  • dependabot/fetch-metadata v1 composite
.github/workflows/pypi-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
poetry.lock pypi
  • alabaster 1.0.0
  • asgiref 3.8.1
  • babel 2.16.0
  • black 24.10.0
  • cachetools 5.5.0
  • certifi 2024.8.30
  • cfgv 3.4.0
  • chardet 5.2.0
  • charset-normalizer 3.4.0
  • click 8.1.7
  • colorama 0.4.6
  • coverage 7.6.8
  • distlib 0.3.9
  • django 5.1.3
  • docutils 0.21.2
  • exceptiongroup 1.2.2
  • filelock 3.16.1
  • flake8 7.1.1
  • identify 2.6.3
  • idna 3.10
  • imagesize 1.4.1
  • iniconfig 2.0.0
  • isort 5.13.2
  • jinja2 3.1.4
  • markupsafe 3.0.2
  • mccabe 0.7.0
  • mypy 1.13.0
  • mypy-extensions 1.0.0
  • nodeenv 1.9.1
  • packaging 24.2
  • pathspec 0.12.1
  • platformdirs 4.3.6
  • pluggy 1.5.0
  • pre-commit 3.8.0
  • pycodestyle 2.12.1
  • pyflakes 3.2.0
  • pygments 2.18.0
  • pyproject-api 1.8.0
  • pytest 8.3.3
  • pytest-cov 5.0.0
  • pytest-django 4.9.0
  • pyyaml 6.0.2
  • requests 2.32.3
  • snowballstemmer 2.2.0
  • sphinx 8.1.3
  • sphinxcontrib-applehelp 2.0.0
  • sphinxcontrib-devhelp 2.0.0
  • sphinxcontrib-htmlhelp 2.1.0
  • sphinxcontrib-jsmath 1.0.1
  • sphinxcontrib-qthelp 2.0.0
  • sphinxcontrib-serializinghtml 2.0.0
  • sqlparse 0.5.2
  • tomli 2.2.1
  • tox 4.23.2
  • typing-extensions 4.12.2
  • tzdata 2024.2
  • urllib3 2.2.3
  • virtualenv 20.28.0