Skip to main content

A reusable Django app for creating, logging and verifying purchases.

Project description

A reusable Django app for creating, logging and verifying purchases.

Quick start

  1. Install Django Purchase Core & Dependancies:

    >>> pip install game-core-purchase
    
  2. Add “purchase”, “rest_framework’, and “rangefilter” to your INSTALLED_APPS setting like this:

INSTALLED_APPS = [
    ...,
    'rest_framework',
    'purchase',
    'rangefilter',
    ...,
]
  1. Add the following to app_config.urls:

from django.conf.urls import url, include

urlpatterns = [
    ...,
    path("api/", include("purchase.urls")),
    ...,
]
  1. Run Django Commands:

    >>> python manage.py makemigrations
    >>> python manage.py migrate
    
  2. Configure configuration and credentials for your game in the admin panel.

Add progress level update processing

  1. Set update_player_progress_class in ProcessPurchaseView

from purchase.view import ProcessPurchaseView
from my_app import UpdateClass

class ProcessPurchaseViewWithUpdate(ProcessPurchaseView):
    update_player_progress_class = UpdateClass
  1. Describe the player’s update logic in the update_player_progress method

from purchase.view import ProcessPurchaseView
from my_app import UpdateClass

class ProcessPurchaseViewWithUpdate(ProcessPurchaseView):
    update_player_progress_class = UpdateClass

    def update_player_progress(self):
        handler = self.update_player_progress_class()
        handler.update_player_progress()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-purchase-core-0.1.3.tar.gz (16.3 kB view hashes)

Uploaded Source

Built Distribution

django_purchase_core-0.1.3-py3-none-any.whl (25.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page