Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Configures the automatically generated release notes:
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
changelog:
exclude:
authors:
- dependabot[bot]
- pre-commit-ci[bot]
82 changes: 70 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,30 @@ name: Release
on:
push:
tags:
- '*'
- '*'
- '!*.dev*'

env:
PYPI_URL: https://pypi.org/p/django-push-notifications

permissions: {}

jobs:
build:
if: github.repository == 'jazzband/django-push-notifications'
if: github.repository == 'django-commons/django-push-notifications'
runs-on: ubuntu-24.04
permissions:
contents: read

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v7
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: 3.8
python-version: '3.x'

- name: Install dependencies
run: |
Expand All @@ -30,10 +38,60 @@ jobs:
python -m build
twine check dist/*

- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Store the distribution packages
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
needs:
- build
runs-on: ubuntu-24.04
environment:
name: pypi
url: ${{ env.PYPI_URL }}
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-push-notifications/upload
name: python-package-distributions
path: dist/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3

github-release:
needs:
- publish-to-pypi
runs-on: ubuntu-24.04
permissions:
contents: write

steps:
- name: Download all the dists
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
name: python-package-distributions
path: dist/

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
"${GITHUB_REF_NAME}"
--repo '${{ github.repository }}'
--draft
--generate-notes

- name: Upload packages to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
"${GITHUB_REF_NAME}" dist/**
--repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Pablo Martín

The full contributor list is available at the following URL:

https://github.com/jazzband/django-push-notifications/graphs/contributors
https://github.com/django-commons/django-push-notifications/graphs/contributors
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 2.0.0 (unreleased)
* Switch from Jazzband org to Django Commons
* Switched to trusted publisher release process with Django Commons
* BACKWARDS-INCOMPATIBLE: Drop support for Django Rest Framework < 3.7
* BACKWARDS-INCOMPATIBLE: NotificationError is now moved from `__init__.py` to `exceptions.py`
* Import with `from push_notifications.exceptions import NotificationError`
Expand Down
7 changes: 2 additions & 5 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Code of Conduct

The django-push-notifications project adopts the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md).
The django-push-notifications project utilizes the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md).

By participating in this project, you agree to abide by this Code of Conduct.
Please report violations to the Django Commons Code of Conduct team at
[django-commons-coc@googlegroups.com](mailto:django-commons-coc@googlegroups.com),
following the reporting guidance in the Code of Conduct.
---
22 changes: 9 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
django-push-notifications
=========================

.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband

.. image:: https://github.com/jazzband/django-push-notifications/workflows/Test/badge.svg
:target: https://github.com/jazzband/django-push-notifications/actions
.. image:: https://github.com/django-commons/django-push-notifications/workflows/Test/badge.svg
:target: https://github.com/django-commons/django-push-notifications/actions
:alt: GitHub Actions

.. image:: https://codecov.io/gh/jazzband/django-push-notifications/branch/master/graph/badge.svg?token=PcC594rhI4
:target: https://codecov.io/gh/jazzband/django-push-notifications
.. image:: https://codecov.io/gh/django-commons/django-push-notifications/branch/master/graph/badge.svg?token=PcC594rhI4
:target: https://codecov.io/gh/django-commons/django-push-notifications
:alt: Code coverage

A minimal Django app that implements Device models that can send messages through APNS, FCM/GCM, WNS and WebPush.
Expand Down Expand Up @@ -75,17 +71,17 @@ Edit your settings.py file:
}

.. note::
To migrate from legacy FCM APIs to HTTP v1, see `docs/FCM <https://github.com/jazzband/django-push-notifications/blob/master/docs/FCM.rst>`_.
To migrate from legacy FCM APIs to HTTP v1, see `docs/FCM <https://github.com/django-commons/django-push-notifications/blob/master/docs/FCM.rst>`_.

.. note::
If you need to support multiple mobile applications from a single Django application, see `Multiple Application Support <https://github.com/jazzband/django-push-notifications/wiki/Multiple-Application-Support>`_ for details.
If you need to support multiple mobile applications from a single Django application, see `Multiple Application Support <https://github.com/django-commons/django-push-notifications/wiki/Multiple-Application-Support>`_ for details.

.. note::
If you are planning on running your project with ``APNS_USE_SANDBOX=True``, then make sure you have set the
*development* certificate as your ``APNS_CERTIFICATE``. Otherwise the app will not be able to connect to the correct host. See settings_ for details.


For more information about how to generate certificates, see `docs/APNS <https://github.com/jazzband/django-push-notifications/blob/master/docs/APNS.rst>`_.
For more information about how to generate certificates, see `docs/APNS <https://github.com/django-commons/django-push-notifications/blob/master/docs/APNS.rst>`_.

You can learn more about APNS certificates `here <https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html>`_.

Expand All @@ -108,7 +104,7 @@ For WNS, you need both the ``WNS_PACKAGE_SECURITY_KEY`` and the ``WNS_SECRET_KEY

**APNS settings**

- ``APNS_CERTIFICATE``: Absolute path to your APNS certificate file. Certificates with passphrases are not supported. If iOS application was build with "Release" flag, you need to use production certificate, otherwise debug. Read more about `Generation of an APNS PEM file <https://github.com/jazzband/django-push-notifications/blob/master/docs/APNS.rst>`_.
- ``APNS_CERTIFICATE``: Absolute path to your APNS certificate file. Certificates with passphrases are not supported. If iOS application was build with "Release" flag, you need to use production certificate, otherwise debug. Read more about `Generation of an APNS PEM file <https://github.com/django-commons/django-push-notifications/blob/master/docs/APNS.rst>`_.
- ``APNS_AUTH_KEY_PATH``: Absolute path to your APNS signing key file for `Token-Based Authentication <https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_token-based_connection_to_apns>`_ . Use this instead of ``APNS_CERTIFICATE`` if you are using ``.p8`` signing key certificate.
- ``APNS_AUTH_KEY_ID``: The 10-character Key ID you obtained from your Apple developer account
- ``APNS_TEAM_ID``: 10-character Team ID you use for developing your company’s apps for iOS.
Expand All @@ -133,7 +129,7 @@ For WNS, you need both the ``WNS_PACKAGE_SECURITY_KEY`` and the ``WNS_SECRET_KEY
- ``WP_CLAIMS``: Dictionary with default value for the sub, (subject), sent to the webpush service, This would be used by the service if they needed to reach out to you (the sender). Could be a url or mailto e.g. {'sub': "mailto:development@example.com"}.
- ``WP_ERROR_TIMEOUT``: The timeout on WebPush POSTs. (Optional, default value is 1 second)

For more information about how to configure WebPush, see `docs/WebPush <https://github.com/jazzband/django-push-notifications/blob/master/docs/WebPush.rst>`_.
For more information about how to configure WebPush, see `docs/WebPush <https://github.com/django-commons/django-push-notifications/blob/master/docs/WebPush.rst>`_.


Sending messages
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project = "django-push-notifications"
author = "django-push-notifications contributors"
copyright = "2018-2026, Jazzband; 2026, Django Commons"

extensions = []
root_doc = "index"
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ A Django app for sending push notifications through APNS, FCM/GCM, WNS and WebPu
Contributing
------------

See the `contribution guide <https://github.com/jazzband/django-push-notifications/blob/master/CONTRIBUTING.md>`_
and `Code of Conduct <https://github.com/jazzband/django-push-notifications/blob/master/CODE_OF_CONDUCT.md>`_.
See the `contribution guide <https://github.com/django-commons/django-push-notifications/blob/master/CONTRIBUTING.md>`_
and `Code of Conduct <https://github.com/django-commons/django-push-notifications/blob/master/CODE_OF_CONDUCT.md>`_.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = django-push-notifications
description = Send push notifications to mobile devices through GCM, APNS or WNS and to WebPush (Chrome, Firefox and Opera) in Django
author = Jerome Leclanche
author_email = jerome@leclan.ch
url = https://github.com/jazzband/django-push-notifications
download_url = https://github.com/jazzband/django-push-notifications/tarball/master
url = https://github.com/django-commons/django-push-notifications
download_url = https://github.com/django-commons/django-push-notifications/tarball/master
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Expand Down
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
SECRET_KEY = "foobar"

PUSH_NOTIFICATIONS_SETTINGS = {
"WP_CLAIMS": {"sub": "mailto:jazzband@example.com"}
"WP_CLAIMS": {"sub": "mailto:django-commons@example.com"}
}
2 changes: 1 addition & 1 deletion tests/settings_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
SECRET_KEY = "foobar"

PUSH_NOTIFICATIONS_SETTINGS = {
"WP_CLAIMS": {"sub": "mailto:jazzband@example.com"},
"WP_CLAIMS": {"sub": "mailto:django-commons@example.com"},
"UNIQUE_REG_ID": True
}