django-wallet
Apple Wallet integration for a django a project
Getting Started
To get started you should copy the 'wallets' folder to the your project directory
git clone https://github.com/Silver3310/django-wallets
cp -r django-wallets/wallets your-project-directory
Prerequisites
If you want to make asynchronous pushes to users when their passes are updated you should install celery
pip install celery
Installing
After you copied the app to your project directory, you should do the following steps
Add the app to your project settings
INSTALLED_APPS = [
...
'wallets',
...
]
# Wallets management
path(
"/",
include("index_auth_service.wallets.urls")
),
Define the model with your Pass from PassAbstract and add fields you need
from wallets.models import PassAbstract
class Pass(PassAbstract):
"""
The pass model for Apple Wallet
"""
discount_card = models.ForeignKey(
DiscountCard,
on_delete=models.CASCADE,
verbose_name=_('Discount card')
)
Add the necessary constants
# APPLE WALLET
WALLET_CERTIFICATE_PATH = 'path-to-certificate-pem-file'
WALLET_KEY_PATH = 'path-to-key-certificate-pem-file'
WALLET_WWDR_PATH = 'path-to-wwdr-certificate-pem-file'
WALLET_PASS_TYPE_ID = 'pass.com.you.pass.id'
WALLET_PASS_PATH = os.path.join(
'the-path-where-you-want-store-passes',
'passes',
'pass{}.pkpass'
)
WALLET_TEAM_IDENTIFIER = 'your-team-identifier'
WALLET_ORGANIZATION_NAME = 'organization-name'
WALLET_APN_HOST = ('gateway.push.apple.com', 2195)
WALLET_ANDROID_HOST = 'https://push.walletunion.com/send'
WALLET_ANDROID_API_KEY = 'get-it-in-the-official-site'
WALLET_PASSWORD = 'certificate-key-passowrd'
WALLET_ENABLE_NOTIFICATIONS = False # True if you want to send notifications (Celery needed for it)
PASS_MODEL = 'your_app.your_model'
Make migrations for your model and the wallets app and migrate them
python manage.py makemigrations
python manage.py migrate
License
This project is licensed under the MIT License - see the LICENSE.txt file for details
Metadata
Release files for django-wallet 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-wallet-0.3.tar.gz | 9.8 kB | Without provenance | Details for django-wallet-0.3.tar.gz |
Release files / django-wallet-0.3.tar.gz
| Download URL | django-wallet-0.3.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d627e28fda60d91884cebcfb947d44a256b2ae53814d228fa6259e1fc9f3548
|
|
BLAKE2b-256 checksum How to use checksums |
70e3822afba1797630872c5a8c0d5c1bfc29aa098010eda0bf3b4fb74ce54949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3
|
Security for django-wallet 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.