|
@@ -28,9 +28,9 @@ class Test(View):
|
|
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
def get(self, request, *args, **kwargs):
|
|
response = ResponseObject()
|
|
response = ResponseObject()
|
|
- devToken = request.GET.get('devToken', None)
|
|
|
|
- app_key = request.GET.get('app_key', None)
|
|
|
|
- master_secret = request.GET.get('master_secret', None)
|
|
|
|
|
|
+ devToken = request.GET.get('devToken', '')
|
|
|
|
+ app_key = request.GET.get('app_key', '')
|
|
|
|
+ master_secret = request.GET.get('master_secret', '')
|
|
import jpush as jpush
|
|
import jpush as jpush
|
|
|
|
|
|
# 此处换成各自的app_key和master_secret
|
|
# 此处换成各自的app_key和master_secret
|
|
@@ -39,7 +39,7 @@ class Test(View):
|
|
# if you set the logging level to "DEBUG",it will show the debug logging.
|
|
# if you set the logging level to "DEBUG",it will show the debug logging.
|
|
_jpush.set_logging("DEBUG")
|
|
_jpush.set_logging("DEBUG")
|
|
# push.audience = jpush.all_
|
|
# push.audience = jpush.all_
|
|
- push.audience = jpush.registration_id(devToken)
|
|
|
|
|
|
+ push.audience = jpush.registration_id([devToken])
|
|
push.notification = jpush.notification(alert="hello python jpush api")
|
|
push.notification = jpush.notification(alert="hello python jpush api")
|
|
push.platform = jpush.all_
|
|
push.platform = jpush.all_
|
|
try:
|
|
try:
|