<commit_before>django-push-notifications
=========================

.. image:: https://api.travis-ci.org/Adys/django-push-notifications.png
	:target: https://travis-ci.org/Adys/django-push-notifications

A minimal Django app that implements Device models that can send messages through APNS and GCM.

The app implements two models: GCMDevice and APNSDevice. Those models share the same attributes:
 - name (optional): A name for the device.
 - is_active (default True): A boolean that determines whether the device will be sent notifications.
 - user (optional): A foreign key to auth.User, if you wish to link the device to a specific user.
 - device_id (optional): A UUID for the device obtained from Android/iOS APIs, if you wish to uniquely identify it.
 - registration_id (required): The GCM registration id or the APNS token for the device.


The app also implements an admin panel, through which you can test single and bulk notifications. Select one or more
GCM or APNS devices and in the action dropdown, select "Send test message" or "Send test message in bulk", accordingly.
Note that sending a non-bulk test message to more than one device will just iterate over the devices and send multiple
single messages.


Dependencies
------------
All versions of Django 1.0 and newer should be supported, however no guarantees are made for versions older than 1.4.
The app also depends on django-uuidfield.

Tastypie support should work on Tastypie 0.9.11 and newer.


Setup
-----
You can install the library directly from pypi using pip::

	$ pip install django-push-notifications


Edit your settings.py file::

	INSTALLED_APPS = (
		...
		"push_notifications"
	)

	PUSH_NOTIFICATIONS_SETTINGS = {
		"GCM_API_KEY": "<your api key>",
		"APNS_CERTIFICATE": "/path/to/your/certificate.pem",
	}


Settings list
-------------
All settings are contained in a PUSH_NOTIFICATIONS_SETTINGS dict.

In order to use GCM, you are required to include GCM_API_KEY.
For APNS, you are required to include APNS_CERTIFICATE.
<commit_msg>Document six requirement on <1.5<commit_after>django-push-notifications
=========================

.. image:: https://api.travis-ci.org/Adys/django-push-notifications.png
	:target: https://travis-ci.org/Adys/django-push-notifications

A minimal Django app that implements Device models that can send messages through APNS and GCM.

The app implements two models: GCMDevice and APNSDevice. Those models share the same attributes:
 - name (optional): A name for the device.
 - is_active (default True): A boolean that determines whether the device will be sent notifications.
 - user (optional): A foreign key to auth.User, if you wish to link the device to a specific user.
 - device_id (optional): A UUID for the device obtained from Android/iOS APIs, if you wish to uniquely identify it.
 - registration_id (required): The GCM registration id or the APNS token for the device.


The app also implements an admin panel, through which you can test single and bulk notifications. Select one or more
GCM or APNS devices and in the action dropdown, select "Send test message" or "Send test message in bulk", accordingly.
Note that sending a non-bulk test message to more than one device will just iterate over the devices and send multiple
single messages.


Dependencies
------------
All versions of Django 1.0 and newer should be supported, however no guarantees are made for versions older than 1.4.
The app also depends on django-uuidfield.

Tastypie support should work on Tastypie 0.9.11 and newer.

Django versions older than 1.5 require 'six' to be installed.


Setup
-----
You can install the library directly from pypi using pip::

	$ pip install django-push-notifications


Edit your settings.py file::

	INSTALLED_APPS = (
		...
		"push_notifications"
	)

	PUSH_NOTIFICATIONS_SETTINGS = {
		"GCM_API_KEY": "<your api key>",
		"APNS_CERTIFICATE": "/path/to/your/certificate.pem",
	}


Settings list
-------------
All settings are contained in a PUSH_NOTIFICATIONS_SETTINGS dict.

In order to use GCM, you are required to include GCM_API_KEY.
For APNS, you are required to include APNS_CERTIFICATE.

{'fraction_non_alphanumeric': 0.08963178294573644, 'fraction_numerical': 0.0048449612403100775, 'mean_word_length': 3.956782713085234, 'pattern_counts': {'":': 4, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2160977', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1135, 'n_words': 534}