質問

I would like to implement a badge app in a Django project to provide the same functionality like Stackoverflow to award users badges.

I have looked at various apps (list of apps), and various blogs have mentioned Brabeion. Is that the best Django app for Badges?

The project seems to be not maintained for some time and questions on github remained unanswered. The documentation is straight-forward, however details are not explained, e.g. what the method award_points is in the example below.

def my_view(request):
    if request.method == "POST":
        # do some things
        request.user.profile.award_points(15)
        badges.possibly_award_badge("points_awarded", user=request.user)
    # more view

On the other hand, djangopackages.com lists Django-achievements. The documentation seems good and detailed, however, each achievement needs its own class (could a long class definition file).

What are you using for your projects? If you use one of the described packages, is there a chance you could share some code around the point registration?

役に立ちましたか?

解決

I don't have an answer, but I'm researching the same question. I've repeatedly come across brabeion and django-badges, of the two django-badges seems the best to me.

None of the options seem extremely production proven though, I'd also like to know if anyone has used any of these, and what their experiences/suggestions are.

The reward points could be as simple as:

request.user.get_profile().award_points(15)

def award_points(points):
   self.points += points

他のヒント

Django-badger is another solution that still seems to be in active development.

https://github.com/mozilla/django-badger

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top