wagtail-webradio


Namewagtail-webradio JSON
Version 0.6.2 PyPI version JSON
download
home_page
SummaryManage your web radio - e.g. podcasts, programs - in Wagtail
upload_time2024-02-21 14:37:31
maintainer
docs_urlNone
authorCliss XXI
requires_python<4,>=3.8
licenseAGPLv3+
keywords wagtail radio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # wagtail-webradio

Manage your web radio - e.g. podcasts, programs - in Wagtail.

**Warning!** This project is still early on in its development lifecycle. It is
possible for breaking changes to occur between versions until reaching a stable
1.0. Feedback and pull requests are welcome.

## Requirements

This package requires the following:
- **Wagtail** (4.1 LTS, 5.0)
- **Django** (3.2 LTS, 4.2 LTS)
- **Python 3** (3.8, 3.9, 3.10, 3.11)

## Installation

1. Install using ``pip``:
   ```shell
   pip install wagtail-webradio
   ```
2. Add ``wagtail_webradio`` to your ``INSTALLED_APPS`` setting:
   ```python
   INSTALLED_APPS = [
       # ...
       'wagtail_webradio',
       # ...
   ]
   ```
3. Run ``python manage.py migrate`` to create the models

## Usage
### Configuration
#### `WEBRADIO_PODCAST_SOUND_FILE`

Default: ``True``

When set to ``False``, the sound file field of a podcast is disabled and it is
only possible to set the sound by its URL.


#### `WEBRADIO_ALLOWED_AUDIO_MIME_TYPES`

Default:
```python
['audio/ogg', 'audio/mpeg', 'audio/flac', 'audio/opus']
```

A list of audio MIME types which are allowed when uploading a podcast's sound file.

### Frontend components

A player with a playlist management is provided to be easily included into your
frontend. Under the hood, it uses [django-unicorn] with a bit of JavaScript to
manipulate the audio from the Web browser. It is currently unstyled but you can
find an [example][1] when using Bootstrap. You should also have a look to the
[template][2] of this component to know how to extend it.

To make use of it:

1. Install the ``player`` extra of this package:
   ```shell
   pip install wagtail-webradio[player]
   ```
2. Integrate ``Unicorn`` in your project by [following the documentation][3]
3. Configure ``Unicorn`` settings to look for this package's components:
   ```python
   UNICORN = {
       'APPS': ['wagtail_webradio'],
   }
   ```

Then, e.g. in ``base.html``, load the player scripts in the ``<head>`` of your
document and the component in the ``<body>``:
```django
<html>
  <head>
    <!-- […] -->

    <script src="{% static "wagtail_webradio/player/js/main.js" %}" defer></script>
  </head>
  <body>
    <! -- […] -->

    {% unicorn "player" %}

    <! -- […] -->
  </body>
</html>
```

In the case of multi-process production environment, you must switch to redis,
memcache or database caching to make Unicorn working correctly. For example with
memcache listening through unix socket, you can add in settings.py :
```
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
        'LOCATION': 'unix:/var/run/memcached/memcached.sock',
    }
}
```

When the player scripts are loaded, you can simply add a song to the playlist
by defining a ``data-player-add-podcast`` or ``data-player-add`` attribute on an
element, and optionally ``data-player-autoplay`` to play the song once added:
```html
<button data-player-add-podcast="10" data-player-autoplay>Add a podcast by id</button>

<button data-player-add="{'title': 'Title', 'subtitle': 'Subtitle', 'url': 'http://example.org/song.ogg', 'thumbnail_url': 'http://example.org/thumb.png'}">
  Add a song
</button>
```

[1]: examples/player/styles.scss
[2]: wagtail_webradio/templates/wagtail_webradio/components/player.html
[3]: https://www.django-unicorn.com/docs/installation/#integrate-unicorn-with-django
[django-unicorn]: https://www.django-unicorn.com/

## Development
### Quick start

To set up a development environment, ensure that Python 3 is installed on your
system. Then:

1. Clone this repository
2. Create a virtual environment and activate it:
   ```shell
   python3 -m venv venv
   source venv/bin/activate
   ```
3. Install this package and its requirements:
   ```shell
   (venv)$ pip install -r requirements-dev.txt
   ```

If you plan to upload the package on PyPi, you will also need to run:
```shell
pip install --upgrade build twine
```

### Contributing

The tests are written with [pytest] and code coverage is measured with [coverage].
You can use the following commands while developing:
- ``make test``: run the tests and output a quick report of code coverage
- ``make test-wip``: only run the tests marked as 'wip'
- ``make test-all``: run the tests on all supported versions of Django and
  Wagtail with [nox]

The Python code is formatted and linted thanks to [flake8], [isort] and [black].
All of these tools are configured in [pre-commit] and you should consider to
install its git hook scripts by running:
```shell
(venv)$ pre-commit install
```

When submitting a pull-request, please ensure that the code is well formatted
and covered, and that all the tests pass.

[pytest]: https://docs.pytest.org/
[coverage]: https://coverage.readthedocs.io/
[nox]: https://nox.thea.codes/
[flake8]: https://flake8.pycqa.org/
[isort]: https://pycqa.github.io/isort/
[black]: https://black.readthedocs.io/
[pre-commit]: https://pre-commit.com/

## License

This extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and
licensed under the [AGPLv3+](LICENSE). Any contribution is welcome!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "wagtail-webradio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.8",
    "maintainer_email": "",
    "keywords": "wagtail,radio",
    "author": "Cliss XXI",
    "author_email": "contact@cliss21.com",
    "download_url": "https://files.pythonhosted.org/packages/7d/4d/70d587720359136bb22884a4405e3ce8eeacfe93c3d8e9c58ab43e6c33a0/wagtail-webradio-0.6.2.tar.gz",
    "platform": null,
    "description": "# wagtail-webradio\n\nManage your web radio - e.g. podcasts, programs - in Wagtail.\n\n**Warning!** This project is still early on in its development lifecycle. It is\npossible for breaking changes to occur between versions until reaching a stable\n1.0. Feedback and pull requests are welcome.\n\n## Requirements\n\nThis package requires the following:\n- **Wagtail** (4.1 LTS, 5.0)\n- **Django** (3.2 LTS, 4.2 LTS)\n- **Python 3** (3.8, 3.9, 3.10, 3.11)\n\n## Installation\n\n1. Install using ``pip``:\n   ```shell\n   pip install wagtail-webradio\n   ```\n2. Add ``wagtail_webradio`` to your ``INSTALLED_APPS`` setting:\n   ```python\n   INSTALLED_APPS = [\n       # ...\n       'wagtail_webradio',\n       # ...\n   ]\n   ```\n3. Run ``python manage.py migrate`` to create the models\n\n## Usage\n### Configuration\n#### `WEBRADIO_PODCAST_SOUND_FILE`\n\nDefault: ``True``\n\nWhen set to ``False``, the sound file field of a podcast is disabled and it is\nonly possible to set the sound by its URL.\n\n\n#### `WEBRADIO_ALLOWED_AUDIO_MIME_TYPES`\n\nDefault:\n```python\n['audio/ogg', 'audio/mpeg', 'audio/flac', 'audio/opus']\n```\n\nA list of audio MIME types which are allowed when uploading a podcast's sound file.\n\n### Frontend components\n\nA player with a playlist management is provided to be easily included into your\nfrontend. Under the hood, it uses [django-unicorn] with a bit of JavaScript to\nmanipulate the audio from the Web browser. It is currently unstyled but you can\nfind an [example][1] when using Bootstrap. You should also have a look to the\n[template][2] of this component to know how to extend it.\n\nTo make use of it:\n\n1. Install the ``player`` extra of this package:\n   ```shell\n   pip install wagtail-webradio[player]\n   ```\n2. Integrate ``Unicorn`` in your project by [following the documentation][3]\n3. Configure ``Unicorn`` settings to look for this package's components:\n   ```python\n   UNICORN = {\n       'APPS': ['wagtail_webradio'],\n   }\n   ```\n\nThen, e.g. in ``base.html``, load the player scripts in the ``<head>`` of your\ndocument and the component in the ``<body>``:\n```django\n<html>\n  <head>\n    <!-- [\u2026] -->\n\n    <script src=\"{% static \"wagtail_webradio/player/js/main.js\" %}\" defer></script>\n  </head>\n  <body>\n    <! -- [\u2026] -->\n\n    {% unicorn \"player\" %}\n\n    <! -- [\u2026] -->\n  </body>\n</html>\n```\n\nIn the case of multi-process production environment, you must switch to redis,\nmemcache or database caching to make Unicorn working correctly. For example with\nmemcache listening through unix socket, you can add in settings.py :\n```\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',\n        'LOCATION': 'unix:/var/run/memcached/memcached.sock',\n    }\n}\n```\n\nWhen the player scripts are loaded, you can simply add a song to the playlist\nby defining a ``data-player-add-podcast`` or ``data-player-add`` attribute on an\nelement, and optionally ``data-player-autoplay`` to play the song once added:\n```html\n<button data-player-add-podcast=\"10\" data-player-autoplay>Add a podcast by id</button>\n\n<button data-player-add=\"{'title': 'Title', 'subtitle': 'Subtitle', 'url': 'http://example.org/song.ogg', 'thumbnail_url': 'http://example.org/thumb.png'}\">\n  Add a song\n</button>\n```\n\n[1]: examples/player/styles.scss\n[2]: wagtail_webradio/templates/wagtail_webradio/components/player.html\n[3]: https://www.django-unicorn.com/docs/installation/#integrate-unicorn-with-django\n[django-unicorn]: https://www.django-unicorn.com/\n\n## Development\n### Quick start\n\nTo set up a development environment, ensure that Python 3 is installed on your\nsystem. Then:\n\n1. Clone this repository\n2. Create a virtual environment and activate it:\n   ```shell\n   python3 -m venv venv\n   source venv/bin/activate\n   ```\n3. Install this package and its requirements:\n   ```shell\n   (venv)$ pip install -r requirements-dev.txt\n   ```\n\nIf you plan to upload the package on PyPi, you will also need to run:\n```shell\npip install --upgrade build twine\n```\n\n### Contributing\n\nThe tests are written with [pytest] and code coverage is measured with [coverage].\nYou can use the following commands while developing:\n- ``make test``: run the tests and output a quick report of code coverage\n- ``make test-wip``: only run the tests marked as 'wip'\n- ``make test-all``: run the tests on all supported versions of Django and\n  Wagtail with [nox]\n\nThe Python code is formatted and linted thanks to [flake8], [isort] and [black].\nAll of these tools are configured in [pre-commit] and you should consider to\ninstall its git hook scripts by running:\n```shell\n(venv)$ pre-commit install\n```\n\nWhen submitting a pull-request, please ensure that the code is well formatted\nand covered, and that all the tests pass.\n\n[pytest]: https://docs.pytest.org/\n[coverage]: https://coverage.readthedocs.io/\n[nox]: https://nox.thea.codes/\n[flake8]: https://flake8.pycqa.org/\n[isort]: https://pycqa.github.io/isort/\n[black]: https://black.readthedocs.io/\n[pre-commit]: https://pre-commit.com/\n\n## License\n\nThis extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and\nlicensed under the [AGPLv3+](LICENSE). Any contribution is welcome!\n",
    "bugtrack_url": null,
    "license": "AGPLv3+",
    "summary": "Manage your web radio - e.g. podcasts, programs - in Wagtail",
    "version": "0.6.2",
    "project_urls": {
        "Bug Tracker": "https://framagit.org/cliss21/wagtail-webradio/-/issues",
        "Source Code": "https://framagit.org/cliss21/wagtail-webradio"
    },
    "split_keywords": [
        "wagtail",
        "radio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d548e9ee24990fc82de10ff5e75bb51576ab3aba0b25994616a5710ea8a9089c",
                "md5": "07b521449a405e64db19963261960371",
                "sha256": "d167adc5435fb4bcbcea83081d8b651783c7c9c663555c0c057d5e41a488424f"
            },
            "downloads": -1,
            "filename": "wagtail_webradio-0.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07b521449a405e64db19963261960371",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.8",
            "size": 177444,
            "upload_time": "2024-02-21T14:37:28",
            "upload_time_iso_8601": "2024-02-21T14:37:28.502931Z",
            "url": "https://files.pythonhosted.org/packages/d5/48/e9ee24990fc82de10ff5e75bb51576ab3aba0b25994616a5710ea8a9089c/wagtail_webradio-0.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d4d70d587720359136bb22884a4405e3ce8eeacfe93c3d8e9c58ab43e6c33a0",
                "md5": "5e7a01b44fa251679a6516aa15f28a68",
                "sha256": "284f470b3bb8a17831be62837cb737e9b53d2e09150534762e806676df052f35"
            },
            "downloads": -1,
            "filename": "wagtail-webradio-0.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5e7a01b44fa251679a6516aa15f28a68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.8",
            "size": 236943,
            "upload_time": "2024-02-21T14:37:31",
            "upload_time_iso_8601": "2024-02-21T14:37:31.055084Z",
            "url": "https://files.pythonhosted.org/packages/7d/4d/70d587720359136bb22884a4405e3ce8eeacfe93c3d8e9c58ab43e6c33a0/wagtail-webradio-0.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-21 14:37:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "wagtail-webradio"
}
        
Elapsed time: 2.55188s