Skip to main content

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)

Source distribution for django-wallet 0.3
File Size Uploaded
django-wallet-0.3.tar.gz 9.8 kB Details

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

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page