skillfed

fcm-django

Send push notifications to mobile devices and browsers through FCM in Django.

fcm-django v3.2.0 299.5K downloads/30d#7,859 on PyPI794
Permissive license MIT Active released

What it is and what it does

fcm-django bridges Django applications with Firebase Cloud Messaging, providing a model-based interface to manage FCM device registrations and send push notifications. It wraps firebase-admin to handle the complexity of FCM's HTTP v1 API, storing device tokens in a Django model with metadata like device type, user association, and active status, then offering queryset methods to send messages to single or bulk device collections.

The package automates common operational tasks: it marks devices inactive when notifications fail to deliver, provides Django admin integration for testing and management, emits signals when devices are deactivated, and returns detailed batch response metadata so applications can inspect per-device failures. It supports notification messages (with title, body, image) and data messages, with optional dry-run validation before actual delivery.

Use it for:

  • Send targeted push notifications to mobile app users by querying the FCMDevice model and calling send_message() with a Message object.
  • Automatically prune inactive devices by letting the library mark failed-delivery devices as inactive and optionally delete them.
  • Test notification payloads during development using dry_run=True to validate message structure without sending real notifications.
  • Manage multi-device scenarios where one user may have multiple registered devices, using ONE_DEVICE_PER_USER setting to enforce single-device-per-user rules.
  • Inspect batch send failures via response.failed_registration_ids and response.failed_exceptions to diagnose configuration or credential issues.
  • Integrate with Django admin to manually send test notifications and view device registration status.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Django app that integrates Firebase Cloud Messaging to send push notifications to mobile devices and browsers via the Firebase HTTP v1 API.

Yes. The package is actively maintained, supports current Django and Python versions, has no known vulnerabilities, and provides a well-documented, low-friction integration layer for Firebase Cloud Messaging in Django projects. Install it if you need to send push notifications from a Django application.

Install

fcm-django on PyPI

pip

pip install fcm-django

uv

uv add fcm-django

poetry

poetry add fcm-django

Installing fcm-django

Before you install

Low install friction with a pure Python wheel. Maintenance is active with recent commits and a stable codebase supporting Django 4.2 through 5.2 and Python 3.10 through 3.14.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install fcm-django

# In settings.py:
INSTALLED_APPS = [..., "fcm_django"]
FIREBASE_APP = initialize_app()  # from firebase_admin

# Send a message:
from firebase_admin.messaging import Message
from fcm_django.models import FCMDevice

device = FCMDevice.objects.first()
device.send_message(Message(data={"key": "value"}))

Requires firebase-admin to be initialized; set GOOGLE_APPLICATION_CREDENTIALS environment variable to point to your Firebase service account JSON file, or pass credentials explicitly to initialize_app().

Verify before relying

  • Whether firebase-admin>=6.9 is strictly required or only for async queryset operations
  • Performance characteristics when sending to large device populations
  • Specific error handling patterns beyond the documented FirebaseError and ValueError

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — firebase-admin, Django, swapper
Maintenance actively maintained — 129 days since the last release
Last repo commit
First released
Downloads 299,530/month — #7,859 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fcm_django-3.2.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Networking

Tags

django firebase push notificationsfcm django integrationsend push notifications djangofirebase cloud messaging djangomobile push notifications djangobrowser push notifications djangofcm device management
django-integrationfirebasepush-notifications

More Python Modules packages