Skip to main content

Django app which stores, manages FCM push tokens and interacts with them.

Project description

djangoFCMv0.1.0

Django app which stores, manages FCM push tokens and interacts with them.

Description

djangoFCM is Django-compatible application which stores FCM push tokens, their parameters, and automates push notifications routines.

Main feature is for djangoFCM to be a "plug-in" Django application, thus capable to work with "little-to-no" configuring and changes to Django project.

Features

djangoFCM @ v0.1.0 can:

  • store push tokens
  • store push tokens` arbitrary parameters with types:
    • foreign key
  • store push notifications
  • send scheduled push notifications
  • compose recipients for push notifications based on user-specified conditions

Usage example

TODO

sample_project

sample-project is a showcase django project. You can reference to it for usage cases, examples, testing. You must never deploy sample_project in production due to exposed SECRET_KEY.

Getting Started

Dependencies

System dependencies

In means of automatisation, djangoFCM heavily relies on celery (via django-celery-beat), thus it is your task to provide celery and celerybeat processes and message broker (e.g. rabbitMQ).

Python packages

  • django~=3.2.8 might work on lesser versions, not tested
  • django-celery-beat~=2.2.1 might work on lesser versions, not tested
  • pyfcm~=1.5.4 might work on lesser versions, not tested

Django applications

  • django_celery_beat

Installing

Using Python Package Index

  • make sure to use latest pip:

    python3 -m pip install --upgrade pip
    
  • install djangoFCM:

    python3 -m pip install djangoFCM
    

OR download package from releases

  • download release asset (.tar.gz or .whl)

  • make sure to use latest pip:

    python3 -m pip install --upgrade pip
    
  • install djangoFCM from file:

    python3 -m pip install /path/to/downloaded/asset.tar.gz # or .whl
    

OR clone from repository

  • clone project:

    git clone \
            --depth=1 \
            --branch=master \
            git@github.com:omelched/djangoFCM.git \
            </path/to/downloads>
    
  • move /djangoFCM/djangoFCM solely to folder containing django apps

    mv      </path/to/downloads>/djangoFCM/djangoFCM \
            </path/to/django/project/apps>
    
  • remove leftovers

    rm -rf  </path/to/downloads>/djangoFCM
    

Configuring

Installing application

Add djangoFCM to INSTALLED_APPS in your Django project settings.py.

If you installed package the third way, </path/to/django/project/apps> must be added to PYTHONPATH. If you not sure add code below in your Django project manage.py before calling main():

sys.path.append('</path/to/django/project/apps>')

Provide FCM api key via DJANGOFCM_FCM_API_KEY in your Django project settings.py.

Celery

Make sure to point celery to djangoFCM.tasks.send_push_notification task. Use app.autodiscover_tasks() in your celeryapp module or specify in settings:

CELERY_IMPORTS = (
    'djangoFCM.tasks',
)

Provide Celery worker to execute tasks, e.g:

venv/bin/celery -A sample_project worker -l INFO

Official documentation may help.

Celerybeat

Provide Celery beat to start scheduled tasks, e.g:

venv/bin/celery -A sample_project beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler

Official documentation on custom schedulers.

Authors

@omelched (Denis Omelchenko)

Contributors

Changelist

djangoFCM version history and changelist available at releases page.

License

This project is licensed under the GNU APGLv3 License - see the LICENSE file for details.

Acknowledgments

Inspiration, code snippets, etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangoFCM-0.2.1.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

djangoFCM-0.2.1-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file djangoFCM-0.2.1.tar.gz.

File metadata

  • Download URL: djangoFCM-0.2.1.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for djangoFCM-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1c40124f7c852ebd68356ad90128f83d5328c1ddfe9a2a731191e6d36ab9b7a5
MD5 1577b9aa0c74dd82e5ab9e1b38c912f9
BLAKE2b-256 0f7b59c9ca9977874c85b67b5963420097551145519f697e94be70f8fecd98b7

See more details on using hashes here.

Provenance

File details

Details for the file djangoFCM-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: djangoFCM-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for djangoFCM-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c3486b29542e26fd47e3d670adec12ecc15d83470c0e7227c93e44562fafd28
MD5 c9dd91ef7617754bd99de94fd359d2d6
BLAKE2b-256 c05c26e022cd9c8aa752bf2540414deef781d748f474209e7cfe25d2c2075b31

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page