{"id":13614734,"url":"https://github.com/mattjegan/django-gamification","last_synced_at":"2025-12-29T23:34:04.864Z","repository":{"id":57420179,"uuid":"100953787","full_name":"mattjegan/django-gamification","owner":"mattjegan","description":"The missing Django Gamification Package","archived":false,"fork":false,"pushed_at":"2022-12-08T00:41:17.000Z","size":64,"stargazers_count":166,"open_issues_count":8,"forks_count":28,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-04T04:19:00.506Z","etag":null,"topics":["django","gamification","gamification-framework","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattjegan.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-21T13:12:34.000Z","updated_at":"2024-09-02T15:33:26.000Z","dependencies_parsed_at":"2023-01-25T01:31:10.574Z","dependency_job_id":null,"html_url":"https://github.com/mattjegan/django-gamification","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattjegan%2Fdjango-gamification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattjegan%2Fdjango-gamification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattjegan%2Fdjango-gamification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattjegan%2Fdjango-gamification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattjegan","download_url":"https://codeload.github.com/mattjegan/django-gamification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223600421,"owners_count":17171666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","gamification","gamification-framework","python","python3"],"created_at":"2024-08-01T20:01:05.120Z","updated_at":"2025-12-29T23:34:04.815Z","avatar_url":"https://github.com/mattjegan.png","language":"Python","funding_links":[],"categories":["Repositories Coding for Beginners","Python","Projects friendly to Hacktoberfest 1st time contributors"],"sub_categories":["Python"],"readme":"Django Gamification\n===================\n\n|PyPI version| |Build Status| |Downloads|\n\nDjango Gamification aims to fill the gamification sized hole in the\nDjango package ecosystem. In the current state, Django Gamification\nprovides a set of models that can be used to implement gamification\nfeatures in your application. These include a centralised interface for\nkeeping track of all gamification related objects including badges,\npoints, and unlockables.\n\nExample App\n-----------\nAn example app can be found `here \u003chttps://github.com/mattjegan/django-gamification-example-app\u003e`__.\n\nInstallation\n------------\n\nDownload from PyPI:\n\n::\n\n    pip install django-gamification\n\nAnd add to your ``INSTALLED_APPS``:\n\n.. code:: python\n\n    INSTALLED_APPS = [\n        'django.contrib.admin',\n        'django.contrib.auth',\n        'django.contrib.contenttypes',\n        'django.contrib.sessions',\n        'django.contrib.messages',\n        'django.contrib.staticfiles',\n        .\n        .\n        .\n        'django_gamification'\n    ]\n\nFeatures and Examples\n---------------------\n\nConcepts\n~~~~~~~~\n\nDjango Gamification requires the understanding of a few core concepts.\n\n- **BadgeDefinitions:** A template used to create new Badges and update existing Badges.\n- **Badge:** An object that represents some achievable objective in the system that can award points and track its own progression.\n- **UnlockableDefinition:** A template used to create new Unlockables and update existing Unlockables.\n- **Unlockable:** An object that is achieved by some accumulation of points.\n- **Category:** An object used to label other objects like Badges via their BadgeDefinition.\n\nInterfaces\n~~~~~~~~~~\n\nCreating an interface\n^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n\n    from django.contrib.auth.models import User\n    from django.db import models\n    from django_gamification.models import GamificationInterface\n\n    class YourUserModel(User):\n        # Your user fields here\n\n        # The gamification interface\n        interface = models.ForeignKey(GamificationInterface)\n\nBadgeDefinitions and Badges\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreating a new badge\n~~~~~~~~~~~~~~~~~~~~\n\nBy creating a new ``BadgeDefinition``, Django Gamification will\nautomatically create ``Badge`` instances for all your current\n``GamificationInterfaces`` with ``Badge.name``, ``Badge.description``,\n``Badge.points``, ``Badge.progression`` and ``Badge.category`` mimicking\nthe fields on the ``BadgeDefinition``.\n\n.. code:: python\n\n    from django_gamification.models import BadgeDefinition, Category\n\n    BadgeDefinition.objects.create(\n        name='Badge of Awesome',\n        description='You proved your awesomeness',\n        points=50,\n        progression_target=100,\n        category=Category.objects.create(name='Gold Badges', description='These are the top badges'),\n    )\n\nAwarding a badge\n~~~~~~~~~~~~~~~~\n\nYou can manually award a ``Badge`` instance using ``Badge.award()``.\n\n.. code:: python\n\n    from django_gamification.models import Badge\n\n    badge = Badge.objects.first()\n    # badge.acquired = False\n\n    badge.award()\n    # badge.acquired = True\n\nUnlockableDefinitions and Unlockables\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreating a new unlockable\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nBy creating a new ``UnlockableDefinition``, Django Gamification will\nautomatically create ``Unlockable`` instances for all your current\n``GamificationInterfaces`` with ``Unlockable.name``,\n``Unlockable.description``, ``Unlockable.points_required`` mimicking the\nfields on the ``UnlockableDefinition``.\n\n.. code:: python\n\n    from django_gamification.models import UnlockableDefinition\n\n    UnlockableDefinition.objects.create(\n        name='Some super sought after feature',\n        description='You unlocked a super sought after feature',\n        points_required=100\n    )\n\nContributing\n------------\n\nSubmitting an issue or feature request\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you find an issue or have a feature request please open an issue at\n`Github Django Gamification\nRepo \u003chttps://github.com/mattjegan/django-gamification\u003e`__.\n\nWorking on issues\n~~~~~~~~~~~~~~~~~\n\nIf you think that you can fix an issue or implement a feature, please\nmake sure that it isn't assigned to someone or if it is you may ask for\nan update.\n\nOnce an issue is complete, open a pull request so that your contribution\ncan be reviewed. A TravisCI build will run and be attached to your pull\nrequest. Your code must pass these checks.\n\nGet Started!\n~~~~~~~~~~~~\n\nReady to contribute? Here's how to set up `django-gamification` for local\ndevelopment.\n\n1. Fork the `django-gamification` repo on GitHub.\n2. Clone your fork locally::\n\n    $ git clone git@github.com:your_name_here/django-gamification.git\n\n3. Install your local copy into a virtualenv. Assuming you have\n   virtualenvwrapper installed, this is how you set up your fork for local development::\n\n    $ mkvirtualenv django-gamification\n    $ cd django-gamification/\n    $ python setup.py develop\n\n4. Create a branch for local development::\n\n    $ git checkout -b name-of-your-bugfix-or-feature\n\n   Now you can make your changes locally.\n\n5. When you're done making changes, check that your changes pass flake8 and the\n   tests, including testing other Python versions with tox::\n\n        $ py.test\n        $ tox\n\n   To get flake8 and tox, just pip install them into your virtualenv.\n\n6. Commit your changes and push your branch to GitHub::\n\n    $ git add .\n    $ git commit -m \"Your detailed description of your changes.\"\n    $ git push origin name-of-your-bugfix-or-feature\n\n7. Submit a pull request through the GitHub website.\n\n\nHelping others\n~~~~~~~~~~~~~~\n\nAt all times, please be polite with others who are working on issues. It\nmay be their first ever patch and we want to foster a friendly and\nfamiliar open source environment.\n\n.. |PyPI version| image:: https://badge.fury.io/py/django-gamification.svg\n   :target: https://badge.fury.io/py/django-gamification\n.. |Build Status| image:: https://travis-ci.org/mattjegan/django-gamification.svg?branch=master\n   :target: https://travis-ci.org/mattjegan/django-gamification\n.. |Downloads| image:: http://pepy.tech/badge/django-gamification\n   :target: http://pepy.tech/count/django-gamification\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattjegan%2Fdjango-gamification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattjegan%2Fdjango-gamification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattjegan%2Fdjango-gamification/lists"}