ernestofgonzalez / django-amazon-sns-mobile-push-notification Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm running tests on python 3.9
and got the trace
(env) ernestogonzalez@Ernestos-MBP django-amazon-sns-mobile-push-notification %
python3 manage.py test
Traceback (most recent call last):
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/opt/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 855, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/__init__.py", line 4, in <module>
from django.contrib.admin.filters import (
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/filters.py", line 10, in <module>
from django.contrib.admin.options import IncorrectLookupParameters
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/options.py", line 12, in <module>
from django.contrib.admin import helpers, widgets
File "/Users/ernestogonzalez/Documents/django-amazon-sns-mobile-push-notification/env/lib/python3.9/site-packages/django/contrib/admin/widgets.py", line 152
'%s=%s' % (k, v) for k, v in params.items(),
^
SyntaxError: Generator expression must be parenthesized
This is a known incompatibility related to Python issue #32012. For more info check this StackOverflow question.
The quick fix is to upgrade Django to 1.11.17
.
From Local and Remote Notification Programming Guide: Creating the Remote Notification Payload, we see that the "aps"
entry includes a "badge"
entry itself, which accepts an integer to set the app's devices badge number.
We'll had an optional badge
argument to client.Client.publish_to_ios
in order to be able to pass a payload like
{
"aps" : {
"alert" : {
"title" : string,
"body" : string,
"sound": string
},
"badge" : number
},
"id" : string,
"type": string,
"serializer": object
}
In order to pass badge
down to publish_to_ios
we nee to add the badge
param to the following methods:
tasks.send_sns_mobile_push_notification_to_device
models.Device.send
client.Client.publish_to_ios
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.