dreipol / django-scarface

Send push notifications to mobile devices using Amazon SNS
MIT License
43 stars 21 forks source link

extract_keys management command #5

Open YuriHeupa opened 9 years ago

YuriHeupa commented 9 years ago

The command extract_keys listed on docs does not work for me, when i run it gives the following traceback:

Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/Library/Python/2.7/site-packages/django/core/management/init.py", line 385, in execute_from_command_line utility.execute() File "/Library/Python/2.7/site-packages/django/core/management/init.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(_args, _options.dict) File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 338, in execute output = self.handle(_args, _options) File "/Library/Python/2.7/site-packages/scarface/management/commands/extract_keys.py", line 44, in handle groups = re.search(regex, result).groupdict() AttributeError: 'NoneType' object has no attribute 'groupdict'

cmaxo commented 8 years ago

I found a similar issue. The resolution for me was to change the regex in the extract_keys.py management command to look for "BEGIN PRIVATE KEY" and "END PRIVATE KEY" rather than "BEGIN RSA PRIVATE KEY" and "END RSA PRIVATE KEY". I'm using an apple apns_sandbox certificate that was generated a day ago. I'm wondering if they changed from rsa to something else recently.

philipplaeubli commented 8 years ago

Can you check if this is solved with the latest release? https://github.com/dreipol/django-scarface/pull/8 should've fixed the issue.