如何将SteamAPI与Django一起使用?

2024-04-28 21:13:49 发布

您现在位置:Python中文网/ 问答频道 /正文

这怎么可能?我试图在我的网站上添加steam认证按钮,并获得一般信息:用户名、steam id

例如:

views.py

# Example
from django.shortcuts import render
from django.http return HttpResponse

def index(response):
    ...
    return render('link.html', response) # link html contains <a> tag which should lead to steam authentication.
    ...

def afterauth(request):
    if auth = SteamAuth.wasSucessful:
        return HttpResponse("Username: " + SteamAuth.Username() + "SteamID: " + SteamAuth.ID())

我已经得到了API密钥,但是我找不到任何关于如何在Django中使用它的文档。在

我有什么办法可以做到这一点吗?有没有教程或文档可以让我在Django中使用Steam API?在


Tags: djangofrom文档apireturnresponsedefhtml
1条回答
网友
1楼 · 发布于 2024-04-28 21:13:49

您可以使用对django和steam API都有本机支持的^{}包:

Multiple frameworks are supported:

  • Django
  • Flask
  • Pyramid
  • Webpy
  • Tornado

Auth providers

  • ...
  • Soundcloud OAuth2
  • Stackoverflow OAuth2
  • Steam OpenId
  • Stocktwits OAuth2
  • Strava OAuth2
  • Stripe OAuth2
  • ...

相关问题 更多 >